Writing Docs¶
This documentation is built with MkDocs and the Material theme. The pages are Markdown files in docs/, and the navigation is set in mkdocs.yml.
Building Locally¶
pip install -r docs-requirements.txt
mkdocs serve # preview at http://127.0.0.1:8000, reloading on changes
mkdocs build --strict # build as CI does
The git-committers plugin shows each page's contributors by asking the GitHub API. Without a token, it fails once it is rate-limited, so set one:
CI builds with --strict, which fails on any warning, such as a link to a missing page or heading. Run it before pushing.
Adding a Page¶
- Create the Markdown file in the right directory:
user-guide/,admin/, ordeveloper-guide/. - Add it to
navinmkdocs.yml. A page that isn't innavis still built, but readers can't find it.
Images¶
Put images in docs/images/, and link them relative to the page, e.g. ../images/snapshot-list.png from a page in user-guide/. Name them in lowercase with hyphens.
Until a screenshot is taken, leave a comment where it goes, saying what it should show:
<!-- TODO: Add screenshot: ../images/restore-confirm-dialog.png (the restore confirmation dialog) -->
Tip and Warning Boxes¶
Boxes use the admonition syntax. Leave a blank line after the title line, and indent the text by four spaces:
The blank line matters. The pre-commit hook runs Prettier on Markdown, and without it Prettier removes the indent, which leaves an empty box with the text below it.
Diagrams¶
Draw diagrams with Mermaid, in a mermaid code block:
Linking to Canopy¶
Link to Canopy's documentation at https://slaclab.github.io/canopy/ for anything about the server: its settings, API keys, restore hooks, and API.
Publishing¶
Pushing to main builds the site and publishes it to the gh-pages branch, served at https://slaclab.github.io/react-squirrel/. The desktop app bundles the same pages when it is built.