From 0dbe3b6eab243e4a9a048561c16b814821e45692 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 21 Feb 2025 20:02:58 +0100 Subject: [PATCH] Include the Nix version in the title of the manual This makes it easy to see at a glance what the version of the manual is, e.g. "Nix 2.27.0 Reference Manual". --- doc/manual/{book.toml => book.toml.in} | 2 +- doc/manual/meson.build | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) rename doc/manual/{book.toml => book.toml.in} (96%) diff --git a/doc/manual/book.toml b/doc/manual/book.toml.in similarity index 96% rename from doc/manual/book.toml rename to doc/manual/book.toml.in index 213739174b9..34acf642edb 100644 --- a/doc/manual/book.toml +++ b/doc/manual/book.toml.in @@ -1,5 +1,5 @@ [book] -title = "Nix Reference Manual" +title = "Nix @version@ Reference Manual" src = "source" [output.html] diff --git a/doc/manual/meson.build b/doc/manual/meson.build index c4cc9b893c0..8ca5c4e42d7 100644 --- a/doc/manual/meson.build +++ b/doc/manual/meson.build @@ -4,6 +4,8 @@ project('nix-manual', license : 'LGPL-2.1-or-later', ) +fs = import('fs') + nix = find_program('nix', native : true) mdbook = find_program('mdbook', native : true) @@ -83,6 +85,7 @@ manual = custom_target( ''' @0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@ @0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md + sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml rsync -r --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/ (cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3 rm -rf @2@/manual @@ -92,12 +95,13 @@ manual = custom_target( python.full_path(), mdbook.full_path(), meson.current_build_dir(), + meson.project_version(), ), ], input : [ generate_manual_deps, 'substitute.py', - 'book.toml', + 'book.toml.in', 'anchors.jq', 'custom.css', nix3_cli_files,