Contributing to the docs¶
The site is open-closed by design: the common path of adding a new script either updates the site automatically or needs a single one-line edit. Pick the case that matches what you're adding.
Add a new Python script¶
- Drop
myscript.pyinpython/with a top-of-file docstring (Google style). - In
docs/python.md, add two lines:
markdown
### myscript.py
::: myscript
- Push. The Action rebuilds the site and
mkdocstringsrenders the docstring automatically.
Add a new root .cmd¶
- Drop
mything.cmdin the repo root. - Open
docs/cmd-utilities.mdand add one row to the relevant table. - Push.
Add a whole new category¶
- Create
docs/<name>.mdwith an intro and a table of contents. - Add one line to
nav:inmkdocs.yml. - Add one path filter to the
paths:list in.github/workflows/pages.yml. - (Only if the category has its own README to import) add one tuple to
SOURCESinscripts/prebuild.py.
Test locally¶
powershell
cd .github/pages
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python scripts/prebuild.py
mkdocs serve
Visit http://127.0.0.1:8000. mkdocs build --strict exiting cleanly
is the same check the CI runs.
How the build works¶
- Push to
main(or click "Run workflow" in the Actions tab). - The workflow installs the pinned deps from
requirements.txt. prebuild.pycopies external Markdown sources (Sutra READMEs, the AI-commit comparison guide, the Cursor rules) intodocs/_imported/.mkdocs build --strictruns — strict mode fails on broken links.- The artifact is uploaded and
actions/deploy-pages@v4ships it to GitHub Pages.
Total runtime: ~1 minute.