aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/generate-deps.py
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/generate-deps.py
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/generate-deps.py')
-rwxr-xr-xdoc/manual/generate-deps.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/manual/generate-deps.py b/doc/manual/generate-deps.py
new file mode 100755
index 000000000..297bd3939
--- /dev/null
+++ b/doc/manual/generate-deps.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+
+import glob
+import sys
+
+# meson expects makefile-style dependency declarations, i.e.
+#
+# target: dependency...
+#
+# meson seems to pass depfiles straight on to ninja even though
+# it also parses the file itself (or at least has code to do so
+# in its tree), so we must live by ninja's rules: only slashes,
+# spaces and octothorpes can be escaped, anything else is taken
+# literally. since the rules for these aren't even the same for
+# all three we will just fail when we encounter any of them (if
+# asserts are off for some reason the depfile will likely point
+# to nonexistant paths, making everything phony and thus fine.)
+for path in glob.glob(sys.argv[1] + '/**', recursive=True):
+ assert '\\' not in path
+ assert ' ' not in path
+ assert '#' not in path
+ print("ignored:", path)