Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Blame · docs-theme/README.md

Line attribution on main · 80 line(s)

1f8afe73
Keenan Nemetz
21d ago
1 # Documentation theme
2
3 `mkdocs.yml` sets `custom_dir: docs-theme`, so this directory is the whole
4 MkDocs theme. It is local on purpose: the docs use the forge's default Everforest
5 dark/medium palette and typography, and a downloaded theme would add a second
6 visual language (and another dependency) to keep in step.
7
8 | File | What it is |
9 |---|---|
10 | `base.html` | Document shell: top bar, page layout, search palette, footer |
11 | `nav.html` | Recursive sidebar built from `mkdocs.yml`'s `nav` |
12 | `toc.html` | Recursive "On this page" column from `page.toc` |
13 | `404.html` | Missing-path page; listed under `theme.static_templates` |
14 | `assets/docs.css` | Palette tokens, layout, type, tables, code, search, responsive rules |
d1f44d83
Keenan Nemetz
21h ago
15 | `assets/docs.js` | Mobile navigation drawer, search palette, code copy buttons, Mermaid init |
1f8afe73
Keenan Nemetz
21d ago
16 | `assets/pygments.css` | Token colours for fenced code, generated (see below) |
d1f44d83
Keenan Nemetz
21h ago
17 | `assets/mermaid.min.js` | Mermaid 11.12.2, loaded only on pages that opt in |
18 | `assets/mermaid.LICENSE` | Mermaid MIT licence |
1f8afe73
Keenan Nemetz
21d ago
19 | `assets/fonts/` | Lexend and JetBrains Mono WOFF2 subsets, copied from `server/web/static/fonts/` |
20 | `assets/vole-head*.png` | Brand mark, copied from `server/web/static/` |
21 | `assets/favicon*` | Favicons, copied from `server/web/static/` |
22
d1f44d83
Keenan Nemetz
21h ago
23 Static page images live under `docs/assets/`, not here: MkDocs copies that tree
24 with the site, while this directory is the theme. Diagrams are Mermaid source in
25 the page, not assets.
a0172426
Keenan Nemetz
20d ago
26
f784d769
Keenan Nemetz
21h ago
27 The article is the flexible grid column. Both side columns sit at the top of
28 the page and scroll with it: the page is one scroll, with no pinned bar or
29 independently scrolling column. The page outline on the right is hidden below
30 1360px, where the article takes that width.
d1f44d83
Keenan Nemetz
21h ago
31
32 ## Page shape
33
34 A guide starts with prerequisites, then numbered steps with a visible result, a
35 failure section if the steps can fail, and two or three next links. A reference
36 has a definition, a table or signature, one complete example, and the edge
37 cases. When a page grows, put the reference
38 half in indented H3 subsections at the bottom instead of adding a page; keep the
39 task path at the top so the page still reads in order.
40
41 Facts have one home. A guide may show a minimal config snippet; the reference
42 owns every key, default, and limit. Do not repeat a default in both places.
43
44 ## Components
45
46 | Markdown | Use for |
47 |---|---|
48 | `!!! note`, `!!! tip`, `!!! warning`, `!!! danger` | A caveat at the point of decision; danger is for secrets, restore, and irreversible actions |
49 | `.start-grid` / `.start-card` | The three jobs a reader can arrive with, on the overview only |
50 | `<div class="mermaid" data-source="...">` in `<figure class="doc-figure">` | A Mermaid diagram with a caption; set `mermaid: true` in the page front matter |
51
52 Diagrams are Mermaid source rendered in the browser. A page that uses one sets
53 `mermaid: true` in its front matter, and `base.html` loads `mermaid.min.js` only
54 for that page. Put the source in the `data-source` attribute as one line with
55 `;` between statements, and escape quotes and `<br/>` as HTML entities. Keeping
56 the source out of the element's text means MkDocs search does not index graph
57 syntax. Keep labels short: Mermaid sizes nodes to their text, but a subgraph
58 title wider than its contents can still be clipped. The bundled Mermaid is
59 11.12.2; keep the version and its licence file together when updating it.
60
61 Reach for a table first when the content is an inventory, a client/credential
62 matrix, or a list of paths. Mermaid is for a process with arrows; a table wraps
63 and stays readable on a phone.
a0172426
Keenan Nemetz
20d ago
64
1f8afe73
Keenan Nemetz
21d ago
65 The `:root` block in `assets/docs.css` is the Everforest dark/medium token set
66 from `server/web/static/everforest.css` with the layout tokens from
67 `server/web/static/vole.css`. A change to the forge palette belongs in both
68 places; the docs are intentionally dark-only, so there is no light block to keep
69 in sync.
70
71 `assets/pygments.css` is generated. After changing the token mapping, regenerate
72 it with the docs requirements installed:
73
74 ```sh
75 python3 scripts/gen-pygments-css.py
76 ```
77
78 The fonts and brand assets are copies rather than links because
79 `vole pages deploy` skips symbolic links: the published branch must contain the
80 files it serves. Their licenses sit beside them in `assets/fonts/`.