aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/book.toml
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-04-08 21:44:40 +0200
committereldritch horrors <pennae@lix.systems>2024-04-11 13:32:06 +0000
commit725f5cd358b2a3906a1922017fa424666a972758 (patch)
treef7dbdb265fa15e0ce05460adae6a8a4eae5b0812 /doc/manual/book.toml
parenta0875f6adf5f7b8d3c3dced7ccff35ef4b22c864 (diff)
docs: redo content generation for mdbook and manual
manpages can be rendered using the markdown output of mdbook, the rest of the manual can generated out of the main doc/manual source tree. we still use lowdown to actually render manpages instead of eg mdbook-man because lowdown does generate reasonably good manpages (though that is also somewhat debatable, but they're a lot better than mdbook-man). doing this not only lets us drastically simplify the lowdown pipeline, but also remove all custom {{#include}} handling since now mdbook does all of it, even for the manpage builds. even the lowdown wrapper isn't entirely necessary because lowdown can take all wrapper arguments with command line flags rather than bits of input file content. This also implements running mdbook in Meson, in order to generate the manpages. The mdbook outputs are also installed in the usual location. Co-authored-by: Qyriad <qyriad@qyriad.me> Change-Id: I60193f9fd0f15d48872f071af35855cda2a0f40b
Diffstat (limited to 'doc/manual/book.toml')
-rw-r--r--doc/manual/book.toml20
1 files changed, 11 insertions, 9 deletions
diff --git a/doc/manual/book.toml b/doc/manual/book.toml
index e03bed737..ae4ff9b35 100644
--- a/doc/manual/book.toml
+++ b/doc/manual/book.toml
@@ -7,20 +7,22 @@ additional-js = ["redirects.js"]
edit-url-template = "https://github.com/NixOS/nix/tree/master/doc/manual/{path}"
git-repository-url = "https://github.com/NixOS/nix"
-# Handles replacing @docroot@ with a path to ./src relative to that markdown file.
-[preprocessor.docroot]
-renderers = ["html", "linkcheck"]
-command = "python3 doc/manual/docroot.py"
-# I would have thought that @docroot@ replacement had to be done *before*
-# the link preprocessor gets its hands on this book, but nope it's actually
-# the opposite.
-after = ["links"]
-before = ["anchors"]
+# Handles replacing @docroot@ with a path to ./src relative to that markdown file,
+# {{#include handlebars}}, and the @generated@ syntax used within these. it mostly
+# but not entirely replaces the links preprocessor (which we cannot simply use due
+# to @generated@ files living in a different directory to make meson happy). we do
+# not want to disable the links preprocessor entirely though because that requires
+# disabling *all* built-in preprocessors and selectively reenabling those we want.
+[preprocessor.substitute]
+command = "python3 doc/manual/substitute.py"
+before = ["anchors", "links"]
[preprocessor.anchors]
renderers = ["html"]
command = "jq --from-file doc/manual/anchors.jq"
+[output.markdown]
+
[output.linkcheck]
# no Internet during the build (in the sandbox)
follow-web-links = false