Building the docs
The site in docs/ is built with Astro and
Starlight. It has four kinds of pages:
- Hand-written pages in
docs/src/content/docs/, as Markdown or MDX. - The
generate-slurm-scriptpage, fromdocs/cli/generate-slurm-script.qmd: Quarto runs its{bash}examples and writes their output intodocs/src/content/docs/cli/generate-slurm-script.md. - Tutorials, converted from the Jupyter notebooks in
tutorials/bystarlight-notebooks. Each notebook is executed and its outputs are written into an MDX page. - API reference, generated from the docstrings by starlight-pydocs, one page per module.
The configuration (defineDocs in docs/astro.config.mjs), the look, the header, the notebook
tool and the build workflow come from the shared
starlight-theme of the max-models projects;
change them there, and update the version in docs/package.json and
.github/workflows/docs.yml to pick up a new release.
Requirements
Section titled “Requirements”- Node 22 or newer.
- The package installed with the
docsextra:pip install -e ".[docs]". - For
make docs-clionly: Quarto and R with theknitrandrmarkdownpackages.
Commands
Section titled “Commands”make docs-install # npm packages and the Python docs extramake docs-cli # rerun the examples of docs/cli/*.qmd into the CLI pagesmake docs-notebooks # execute tutorials/*.ipynb and convert them to pagesmake docs-dev # live preview at http://localhost:4321/slurm-script-generator/make docs-build # the static site in docs/dist, as in CImake docs-preview # serve docs/distmake docs-clean # remove generated pages and build outputmake docs-notebooks only reruns a notebook whose cells changed since the last run; pass
FORCE=1 to rerun all of them. CI executes the notebooks on every build, but not the Quarto
page: after changing the CLI or docs/cli/generate-slurm-script.qmd, run make docs-cli and
commit the regenerated page.
Writing tutorials
Section titled “Writing tutorials”Put a Jupyter notebook in tutorials/. Its first # Heading becomes the page title and the
first paragraph its description; the file name sets its place in the sidebar. Cell tags control
the output:
| Tag | Effect |
|---|---|
remove-cell | the cell is left out of the page |
hide-input | the code is hidden, the outputs are kept |
fold-input | the code is in a closed “Show code” box |
remove-output | the outputs are left out |
raises-exception | an error output is shown, not a failure |