nixpkgs/pkgs/tools/nix/nixos-render-docs
pennae 7a74ce51a1 nixos-render-docs: add toc generator
the docbook toolchain uses docbook-xsl to generate its TOC, our html
renderer will have to do this on its own. this generator uses a very
straight-forward algorithm of only inspecting headings, but anything
else could be inspected as well. (examples come to mind, but those do
not have titles and would thus make for bad toc entries)

we also use path information (that will be taken from include block args
in the html renderer) to produce navigation information. the algorithm
we use mirrors what docbook does, linking to the next/previous files in
depth-first toc order.

toc entries are linked to the tokens they refer to for easy use later.
2023-02-21 18:26:41 +01:00
..
src nixos-render-docs: add toc generator 2023-02-21 18:26:41 +01:00
default.nix nixos-render-docs: drop frozendict 2023-02-21 18:19:00 +01:00