Skip to content

Commit

Permalink
Include the Nix version in the title of the manual
Browse files Browse the repository at this point in the history
This makes it easy to see at a glance what the version of the manual
is, e.g. "Nix 2.27.0 Reference Manual".
  • Loading branch information
edolstra committed Feb 21, 2025
1 parent 223f82e commit 0dbe3b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/manual/book.toml → doc/manual/book.toml.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[book]
title = "Nix Reference Manual"
title = "Nix @version@ Reference Manual"
src = "source"

[output.html]
Expand Down
6 changes: 5 additions & 1 deletion doc/manual/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 0dbe3b6

Please sign in to comment.