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. Do not put.mdxfiles inguide/: the notebook tool deletes the.mdxpages there that it did not generate. - Tutorials and most guides, converted from the Jupyter notebooks in
notebooks/bystarlight-notebooks: each notebook is executed and its outputs (text, images, tables) are written into an MDX page.notebooks/tutorials/holds the tutorials andnotebooks/guides/the guides; both are built into theguide/section (the tool builds one folder into one section), so a tutorial is at/guide/01-getting-started/. The code in these pages is therefore run on every docs build. The guides for C, Fortran, LIKWID and MCP, which need a compiler, hardware or an MCP client, stay hand-written Markdown indocs/src/content/docs/guide/. - API reference, generated from the docstrings by
starlight-pydocs, one page per module. The
Python API page places single objects among prose with
<Autodoc name="..." />. - Command output:
docs/generate_docs_outputs.pyruns the CLI and the API and writes their output todocs/src/generated/, which the MDX pages import (?raw) instead of copying it into a code fence.
The figures in figures/ and the @scope-profiler/plotly sources in packages/plotly/src/ are
served as they are, at figures/ and plotly/ of the site (docs/public/ links to them), so
the interactive pages always use the checkout’s package. Refresh the figures with
make figures; a docs build only uses them.
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]". - An MPI implementation (
mpiexec) for the MPI examples of the generated output.
Commands
Section titled “Commands”make docs-install # npm packages and the Python docs extramake docs-notebooks # execute notebooks/**/*.ipynb and convert them to pagesmake docs-outputs # run the CLI and API examples into docs/src/generated/make docs-dev # live preview at http://localhost:4321/scope-profiler/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.