Skip to content

Commit c264192

Browse files
AllenDowneyclaude
andcommitted
Jupyter Book: commit the sources that built the live site; fix the parse config.
_toc.yml, index.md, preface.md and build.sh are the local versions used for the published site (last built 2026-02-01) but never committed: the toc, the queue example, and copying the MkDocs API docs into _build/html/api. _config.yml: myst_extended_syntax is deprecated and broken in Jupyter Book 1.0.4 (it adds the extensions as a nested list, and MyST-Parser fails with 'unhashable type: list'); it had been deleted locally since 2023-01-14. Replaced with the same extensions listed individually, plus linkify. A test build with this config is identical to one with no parse section, and matches the live site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent ceb1bda commit c264192

5 files changed

Lines changed: 87 additions & 34 deletions

File tree

‎jb/_config.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,13 @@ html:
2020
use_repository_button: true
2121

2222
parse:
23-
myst_extended_syntax: true
23+
# Replaces the deprecated myst_extended_syntax (broken in current Jupyter Book):
24+
# the same extensions, listed individually, plus linkify for bare URLs.
25+
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
26+
myst_enable_extensions:
27+
- amsmath
28+
- colon_fence
29+
- deflist
30+
- dollarmath
31+
- html_image
32+
- linkify

‎jb/_toc.yml‎

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
1-
file: index
2-
sections:
3-
- file: preface
4-
- file: chap01
5-
- file: chap02
6-
- file: chap03
7-
- file: chap04
8-
- file: chap05
9-
- file: chap06
10-
- file: chap07
11-
- file: chap08
12-
- file: chap09
13-
- file: chap10
14-
- file: chap11
15-
- file: chap12
16-
- file: chap13
17-
- file: chap14
18-
- file: chap15
19-
- file: chap16
20-
- file: chap17
21-
- file: chap18
22-
- file: chap19
23-
- file: chap20
24-
- file: chap21
25-
- file: chap22
26-
- file: chap23
27-
- file: chap24
28-
- file: chap25
29-
- file: chap26
1+
format: jb-book
2+
root: index
3+
parts:
4+
- caption: Chapters
5+
chapters:
6+
- file: preface
7+
- file: chap01
8+
- file: chap02
9+
- file: chap03
10+
- file: chap04
11+
- file: chap05
12+
- file: chap06
13+
- file: chap07
14+
- file: chap08
15+
- file: chap09
16+
- file: chap10
17+
- file: chap11
18+
- file: chap12
19+
- file: chap13
20+
- file: chap14
21+
- file: chap15
22+
- file: chap16
23+
- file: chap17
24+
- file: chap18
25+
- file: chap19
26+
- file: chap20
27+
- file: chap21
28+
- file: chap22
29+
- file: chap23
30+
- file: chap24
31+
- file: chap25
32+
- file: chap26
33+
- file: chap27
34+
- caption: Examples
35+
chapters:
36+
- file: queue
37+
- caption: API Reference
38+
chapters:
39+
- url: https://allendowney.github.io/ModSimPy/api/index.html
40+
title: API Documentation
41+

‎jb/build.sh‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
1+
#!/bin/bash
2+
# Build the Jupyter Book for ModSimPy
3+
4+
set -e
5+
16
# pip install jupyter-book
27
# pip install ghp-import
38

4-
# Build the Jupyter book version
9+
# Build the Jupyter Book version
510

611
# copy the chapter notebooks
712
cp ../ModSimPySolutions/chapters/chap*.ipynb .
13+
cp ../ModSimPySolutions/examples/queue.ipynb .
814

915
# add tags to hide the solutions
1016
python prep_notebooks.py
1117

18+
# remove the old build
19+
rm -rf _build
20+
1221
# build the HTML version
1322
jb build .
1423

24+
# Create the api/ directory if it doesn't exist
25+
mkdir -p _build/html/api
26+
27+
# Copy the MkDocs docs to the Jupyter Book's HTML output
28+
cp -r ../site/* _build/html/api
29+
30+
echo "Jupyter Book built and MkDocs docs copied to _build/html/api/"
31+
1532
# push it to GitHub
1633
ghp-import -n -p -f _build/html
34+
35+
echo "Pushed to GitHub"

‎jb/index.md‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22

33
by Allen B. Downey
44

5-
*Modeling and Simulation in Python* is a Free Book. It is available under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/), which means that you are free to copy and modify it, as long as you attribute the work and don’t use it for commercial purposes.
5+
*Modeling and Simulation in Python* is an introduction to physical modeling in Python, suitable for people with no programming experience.
6+
7+
Printed and electronic copies of the book are available from [No Starch Press](https://nostarch.com/modeling-and-simulation-python) and [Bookshop.org](https://bookshop.org/p/books/modeling-and-simulation-in-python-allen-b-downey/17836697?ean=9781718502161) and [Amazon](https://amzn.to/3y9UxNb).
8+
9+
Here is the [home page for this book at Green Tea Press](https://greenteapress.com/wp/modsimpy/).
10+
11+
[Documentation of the `modsim.py` module is here](https://allendowney.github.io/ModSimPy/api/index.html)
12+
13+
Note that `modsim.py` is just a module, not a Python package, which means you only have to download the file; you don't have to install it.
14+
And if you run the Jupyter notebooks, they download `modsim.py` for you.
615

7-
Other Free Books by Allen Downey are available from [Green Tea Press](https://greenteapress.com/wp/).
816

917
**Run the notebooks**
1018

@@ -63,3 +71,8 @@ Or use these links to run the notebooks on Colab:
6371
* [Chapter 25](https://colab.research.google.com/github/AllenDowney/ModSimPy/blob/master/chapters/chap25.ipynb)
6472

6573
* [Chapter 26](https://colab.research.google.com/github/AllenDowney/ModSimPy/blob/master/chapters/chap26.ipynb)
74+
75+
76+
*Modeling and Simulation in Python* a Free Book. It is available under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/), which means that you are free to copy and modify it, as long as you attribute the work and don’t use it for commercial purposes.
77+
78+
Other Free Books by Allen Downey are available from [Green Tea Press](https://greenteapress.com/wp/).

‎jb/preface.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ To run the notebooks on your computer, there are three steps:
121121

122122
3. Run Jupyter and open the notebooks.
123123

124-
To get the notebooks, download [this Zip archive](http://modsimpy.com/zip). You will need a program like
124+
To get the notebooks, download [this Zip archive](https://github.com/AllenDowney/ModSimPy/raw/refs/heads/master/ModSimPyNotebooks.zip). You will need a program like
125125
WinZip or gzip to unpack the Zip file. Make a note of the location of
126126
the files you download.
127127

0 commit comments

Comments
 (0)