summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig15
1 files changed, 14 insertions, 1 deletions
diff --git a/build.zig b/build.zig
index 7bd43795..71c8637b 100644
--- a/build.zig
+++ b/build.zig
@@ -878,7 +878,7 @@ pub fn build(b: *std.Build) void {
// `typst compile` reads it too; a unit test fails when it is stale.
// A terminal build writes builtins-tui.json and a window build
// builtins-gui.json; style.typ merges the two into one glossary.
- const builtins_json_step = b.step("builtins-json", "rewrite docs/typ/builtins-<tui|gui>.json from the builtin registry (-Dplatform=tui or gui)");
+ const builtins_json_step = b.step("builtins-json", "rewrite docs/typ/builtins-<tui|gui>.json from the builtin registry, and with tui docs/typ/command-line.txt from pardes help --all (-Dplatform=tui or gui)");
if (requested_platform == .tui or requested_platform == .gui) {
const gen = b.addExecutable(.{ .name = "pardes-gen-builtins-json", .root_module = b.createModule(.{
.target = target,
@@ -1184,6 +1184,19 @@ pub fn build(b: *std.Build) void {
.root_module = root_mod,
});
installHome(b, exe, home_bin);
+ // docs/typ/command-line.txt: `pardes help --all`, the commands'
+ // help and the tree's README as this build prints them (never a
+ // session's), which the reference's "The pardes command" shows;
+ // main.zig's test fails when it is stale. The terminal's build
+ // writes it, the window's prints the same.
+ if (requested_platform == .tui) {
+ const run_help = b.addRunArtifact(exe);
+ run_help.addArgs(&.{ "help", "--all" });
+ const update = b.addUpdateSourceFiles();
+ update.addCopyFileToSource(run_help.captureStdOut(.{}), "docs/typ/command-line.txt");
+ builtins_json_step.dependOn(&update.step);
+ for (doc_renders) |r| if (r) |run| run.step.dependOn(&update.step);
+ }
// The addons, a step each: the default install is the binaries
// alone, and `zig build image pdf` (or `addons`) puts the libraries
// where the start scan finds them, <prefix>/lib/pardes/addons (and