This documentation is built using Jupyter Book v2 (MyST).
Setup¶
Install the doc build dependencies:
cd fastsim/docs
pip install -r requirements.txtLocal Development¶
From the docs/ directory, convert the demo scripts to notebooks and
start the dev server:
# Convert demo scripts to notebooks
python demos_to_notebooks.py
# Start the dev server with live reload
jupyter book startThe --execute flag runs the demo notebooks and populates their
outputs, so plots appear in the rendered pages:
jupyter book start --executeThe site will be available at http://localhost:3000.
Building Static HTML¶
jupyter book build --html --executeOutput is written to docs/_build/html/.
Directory Layout¶
docs/
content/ Markdown pages (intro, calibration, developer guides)
demo_scripts/ Source Python scripts for demos
demo_notebooks/ Generated Jupyter notebooks (do not edit directly)
assets/ Images and icons
myst.yml Jupyter Book configuration and table of contents
demos_to_notebooks.py Script to convert demo_scripts/ to demo_notebooks/Adding or Modifying Pages¶
Markdown pages: Add
.mdfiles todocs/content/and reference them in thetoc:section ofmyst.ymlDemo notebooks: Add demo scripts to
docs/demo_scripts/following the existing convention ("""blocks become markdown cells,# %%marks code cell boundaries). Then regenerate notebooks:python demos_to_notebooks.pyOnly files matching
demo*.pyare converted. Other files likeplot_utils.pyandtest_demos.pyare ignored by the converter.Table of Contents: Edit
docs/myst.ymlunderproject.toc:
Publishing¶
Pushing to the fastsim-3 branch triggers a GitHub Actions workflow
(deploy_docs.yaml) that builds and deploys the book to GitHub Pages.