Documentation
The docs are the Markdown files in doc/. GitHub shows them as they are.
Sphinx builds the same files into the website.
Build
uv run poe docs
This builds the site twice:
doc/_build/html/: the website. Opendoc/_build/html/index.html.doc/_build/html/markdown/: the same pages as plain Markdown, for AI tools.
Every warning fails the build. A broken link or a page missing from the menu is a warning.
uv run poe docs-clean removes doc/_build/.
Where to write what
Change |
Update |
|---|---|
a new command |
|
a new option |
the page of each command that takes it |
a new |
|
other git calls in a command |
|
a new task or workflow |
a page in |
the command line |
|
tests/unit/test_docs.py checks that every command, option and
.gitnested field appears in the docs, and every command in the manual
page.
Layout
Path |
What |
|---|---|
|
start page on GitHub. Not part of the site |
|
start page of the site. It holds the menu |
|
Sphinx config |
|
small changes to the theme |
|
the pages |
A new page has to be in a toctree in doc/index.md. Add a line to
doc/README.md too.
Writing style
Keep it short and easy:
Use short sentences and common words.
Say one thing per sentence.
Show a command, then say what it does.
Use
ext/libandhttps://github.com/user/libin examples.
Markdown
The pages are GitHub Markdown, read by MyST.
Link to other pages by their
.mdpath:[pull](../cli/pull.md).Link to a heading with
#:[pin](gitnested-file.md#pin).Link to files outside
doc/with a full GitHub URL. Sphinx can not follow those links.Draw diagrams in a
```mermaidblock. GitHub and the site both draw it.Use GitHub alerts:
> [!NOTE],> [!TIP],> [!WARNING].
Publishing
.github/workflows/docs.yml builds the docs on every pull request. On a
push to main, it also publishes the site to the gh_pages branch. GitHub
Pages serves it at https://thorsten-klein.github.io/git-nested/.
A release tag like 1.2.0 publishes the site again. Then the site shows
the release version.
To publish by hand, start the workflow in the Actions tab, or run:
gh workflow run docs.yml