From e0ea3c82ca9e46359c55c9f716fec016f8d483ea Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 22 Jul 2020 20:27:23 +0200 Subject: Use mdbook --- doc/manual/local.mk | 81 ++++++++++++----------------------------------------- 1 file changed, 18 insertions(+), 63 deletions(-) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index ce05c6234..a91d497ce 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -1,84 +1,39 @@ - ifeq ($(doc_generate),yes) -XSLTPROC = $(xsltproc) --nonet $(xmlflags) \ - --param section.autolabel 1 \ - --param section.label.includes.component.label 1 \ - --param xref.with.number.and.title 1 \ - --param toc.section.depth 3 \ - --param admon.style \'\' \ - --param callout.graphics 0 \ - --param contrib.inline.enabled 0 \ - --stringparam generate.toc "book toc" \ - --param keep.relative.image.uris 0 - -docbookxsl = http://docbook.sourceforge.net/release/xsl-ns/current -docbookrng = http://docbook.org/xml/5.0/rng/docbook.rng - -MANUAL_SRCS := $(call rwildcard, $(d), *.xml) - - -# Do XInclude processing / RelaxNG validation -$(d)/manual.xmli: $(d)/manual.xml $(MANUAL_SRCS) $(d)/version.txt - $(trace-gen) $(xmllint) --nonet --xinclude $< -o $@.tmp - @mv $@.tmp $@ +MANUAL_SRCS := $(call rwildcard, $(d)/src, *.md) -$(d)/version.txt: - $(trace-gen) echo -n $(PACKAGE_VERSION) > $@ +#$(d)/version.txt: +# $(trace-gen) echo -n $(PACKAGE_VERSION) > $@ -# Note: RelaxNG validation requires xmllint >= 2.7.4. -$(d)/manual.is-valid: $(d)/manual.xmli - $(trace-gen) $(XSLTPROC) --novalid --stringparam profile.condition manual \ - $(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \ - $(xmllint) --nonet --noout --relaxng $(docbookrng) - - @touch $@ +clean-files += $(d)/version.txt -clean-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid - -dist-files += $(d)/manual.xmli $(d)/version.txt $(d)/manual.is-valid +dist-files += $(d)/version.txt # Generate man pages. man-pages := $(foreach n, \ - nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ - nix-collect-garbage.1 \ - nix-prefetch-url.1 nix-channel.1 \ - nix-hash.1 nix-copy-closure.1 \ - nix.conf.5 nix-daemon.8, \ + nix-copy-closure.1, \ $(d)/$(n)) - -$(firstword $(man-pages)): $(d)/manual.xmli $(d)/manual.is-valid - $(trace-gen) $(XSLTPROC) --novalid --stringparam profile.condition manpage \ - $(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \ - (cd doc/manual && $(XSLTPROC) $(docbookxsl)/manpages/docbook.xsl -) - -$(wordlist 2, $(words $(man-pages)), $(man-pages)): $(firstword $(man-pages)) +# nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ +# nix-collect-garbage.1, \ +# nix-prefetch-url.1 nix-channel.1 \ +# nix-hash.1 nix-copy-closure.1 \ +# nix.conf.5 nix-daemon.8, \ clean-files += $(d)/*.1 $(d)/*.5 $(d)/*.8 dist-files += $(man-pages) +$(d)/nix-copy-closure.1: $(d)/src/command-ref/nix-copy-closure.md -# Generate the HTML manual. -$(d)/manual.html: $(d)/manual.xml $(MANUAL_SRCS) $(d)/manual.is-valid - $(trace-gen) $(XSLTPROC) --xinclude --stringparam profile.condition manual \ - $(docbookxsl)/profiling/profile.xsl $< | \ - $(XSLTPROC) --output $@ $(docbookxsl)/xhtml/docbook.xsl - +%.1: %.md + $(trace-gen) lowdown -sT man $^ -o $@ -$(foreach file, $(d)/manual.html, $(eval $(call install-data-in, $(file), $(docdir)/manual))) - -$(foreach file, $(wildcard $(d)/figures/*.png), $(eval $(call install-data-in, $(file), $(docdir)/manual/figures))) - -$(eval $(call install-symlink, manual.html, $(docdir)/manual/index.html)) - - -all: $(d)/manual.html - - - -clean-files += $(d)/manual.html +# Generate the HTML manual. +install: $(docdir)/manual/index.html -dist-files += $(d)/manual.html +$(docdir)/manual/index.html: $(MANUAL_SRCS) + $(trace-gen) mdbook build doc/manual -d $(docdir)/manual endif -- cgit v1.2.3 From 8e41c388679aedc12eb1a7a7aff1b4818040ff4a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 22 Jul 2020 20:46:12 +0200 Subject: Remove references to xmllint --- doc/manual/local.mk | 2 -- 1 file changed, 2 deletions(-) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index a91d497ce..65acd658c 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -25,8 +25,6 @@ clean-files += $(d)/*.1 $(d)/*.5 $(d)/*.8 dist-files += $(man-pages) $(d)/nix-copy-closure.1: $(d)/src/command-ref/nix-copy-closure.md - -%.1: %.md $(trace-gen) lowdown -sT man $^ -o $@ # Generate the HTML manual. -- cgit v1.2.3 From efdb89994c2ee79763320d70fb4ba881d0e3b1e8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Jul 2020 10:56:15 +0200 Subject: Convert nix.conf manpage --- doc/manual/local.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 65acd658c..80c517702 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -12,7 +12,8 @@ dist-files += $(d)/version.txt # Generate man pages. man-pages := $(foreach n, \ - nix-copy-closure.1, \ + nix-copy-closure.1 \ + nix.conf.5, \ $(d)/$(n)) # nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ # nix-collect-garbage.1, \ @@ -27,6 +28,9 @@ dist-files += $(man-pages) $(d)/nix-copy-closure.1: $(d)/src/command-ref/nix-copy-closure.md $(trace-gen) lowdown -sT man $^ -o $@ +$(d)/nix.conf.5: $(d)/src/command-ref/conf-file.md + $(trace-gen) lowdown -sT man $^ -o $@ + # Generate the HTML manual. install: $(docdir)/manual/index.html -- cgit v1.2.3 From efff6cf163fb911689b41d7c2970efd8b17876e1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Jul 2020 13:09:30 +0200 Subject: Install all manpages --- doc/manual/local.mk | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 80c517702..13d937f8d 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -12,20 +12,21 @@ dist-files += $(d)/version.txt # Generate man pages. man-pages := $(foreach n, \ - nix-copy-closure.1 \ - nix.conf.5, \ + nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ + nix-collect-garbage.1 \ + nix-prefetch-url.1 nix-channel.1 \ + nix-hash.1 nix-copy-closure.1 \ + nix.conf.5 nix-daemon.8, \ $(d)/$(n)) -# nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ -# nix-collect-garbage.1, \ -# nix-prefetch-url.1 nix-channel.1 \ -# nix-hash.1 nix-copy-closure.1 \ -# nix.conf.5 nix-daemon.8, \ clean-files += $(d)/*.1 $(d)/*.5 $(d)/*.8 dist-files += $(man-pages) -$(d)/nix-copy-closure.1: $(d)/src/command-ref/nix-copy-closure.md +$(d)/%.1: $(d)/src/command-ref/%.md + $(trace-gen) lowdown -sT man $^ -o $@ + +$(d)/%.8: $(d)/src/command-ref/%.md $(trace-gen) lowdown -sT man $^ -o $@ $(d)/nix.conf.5: $(d)/src/command-ref/conf-file.md -- cgit v1.2.3 From 1308c8404e19aacc6458b3813d445857620a60a8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 24 Jul 2020 15:48:40 +0200 Subject: Remove DocBook manual --- doc/manual/local.mk | 9 --------- 1 file changed, 9 deletions(-) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 13d937f8d..2d730a60e 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -2,14 +2,6 @@ ifeq ($(doc_generate),yes) MANUAL_SRCS := $(call rwildcard, $(d)/src, *.md) -#$(d)/version.txt: -# $(trace-gen) echo -n $(PACKAGE_VERSION) > $@ - -clean-files += $(d)/version.txt - -dist-files += $(d)/version.txt - - # Generate man pages. man-pages := $(foreach n, \ nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ @@ -38,5 +30,4 @@ install: $(docdir)/manual/index.html $(docdir)/manual/index.html: $(MANUAL_SRCS) $(trace-gen) mdbook build doc/manual -d $(docdir)/manual - endif -- cgit v1.2.3 From 1d0a7b54fa330b041a720932ee4e05dcad1d2d5c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 31 Jul 2020 15:43:25 +0200 Subject: Enable syntax highlighting --- doc/manual/local.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 2d730a60e..c9104ad7e 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -29,5 +29,6 @@ install: $(docdir)/manual/index.html $(docdir)/manual/index.html: $(MANUAL_SRCS) $(trace-gen) mdbook build doc/manual -d $(docdir)/manual + @cp doc/manual/highlight.pack.js $(docdir)/manual/highlight.js endif -- cgit v1.2.3 From 6f19c776db280a46e84d6e84d83814445869ef37 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 17 Aug 2020 19:33:18 +0200 Subject: Start generation of the nix.1 manpage --- doc/manual/local.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index c9104ad7e..8f917316d 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -4,7 +4,7 @@ MANUAL_SRCS := $(call rwildcard, $(d)/src, *.md) # Generate man pages. man-pages := $(foreach n, \ - nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ + nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 nix.1 \ nix-collect-garbage.1 \ nix-prefetch-url.1 nix-channel.1 \ nix-hash.1 nix-copy-closure.1 \ @@ -24,6 +24,12 @@ $(d)/%.8: $(d)/src/command-ref/%.md $(d)/nix.conf.5: $(d)/src/command-ref/conf-file.md $(trace-gen) lowdown -sT man $^ -o $@ +$(d)/src/command-ref/nix.md: $(d)/nix.json $(d)/generate-manpage.jq + jq -r -f doc/manual/generate-manpage.jq $< > $@ + +$(d)/nix.json: $(bindir)/nix + $(trace-gen) $(bindir)/nix dump-args > $@ + # Generate the HTML manual. install: $(docdir)/manual/index.html -- cgit v1.2.3 From 8a97b11374c5165d3602648c5c0327f103072105 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 19 Aug 2020 12:31:18 +0200 Subject: Improve margins between sections The default CSS puts almost no space between sections, but a lot of space between subsections. This flips that around. --- doc/manual/local.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 8f917316d..04c57b23b 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -33,7 +33,7 @@ $(d)/nix.json: $(bindir)/nix # Generate the HTML manual. install: $(docdir)/manual/index.html -$(docdir)/manual/index.html: $(MANUAL_SRCS) +$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css $(trace-gen) mdbook build doc/manual -d $(docdir)/manual @cp doc/manual/highlight.pack.js $(docdir)/manual/highlight.js -- cgit v1.2.3 From c8fa39324ad7a56a78f8c6f55c42f8f49dbbbf9a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 19 Aug 2020 18:28:04 +0200 Subject: Generate the nix.conf docs from the source code This means we don't have two (divergent) sets of option descriptions anymore. --- doc/manual/local.mk | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 04c57b23b..dcc02d538 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -27,9 +27,16 @@ $(d)/nix.conf.5: $(d)/src/command-ref/conf-file.md $(d)/src/command-ref/nix.md: $(d)/nix.json $(d)/generate-manpage.jq jq -r -f doc/manual/generate-manpage.jq $< > $@ +$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.jq $(d)/src/command-ref/conf-file-prefix.md + cat doc/manual/src/command-ref/conf-file-prefix.md > $@ + jq -r -f doc/manual/generate-options.jq $< >> $@ + $(d)/nix.json: $(bindir)/nix $(trace-gen) $(bindir)/nix dump-args > $@ +$(d)/conf-file.json: $(bindir)/nix + $(trace-gen) env -i NIX_CONF_DIR=/dummy HOME=/dummy $(bindir)/nix show-config --json --experimental-features nix-command > $@ + # Generate the HTML manual. install: $(docdir)/manual/index.html -- cgit v1.2.3 From 0f314f3c2594e80322c675b70a61dcfda11bf423 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Aug 2020 14:49:30 +0200 Subject: Generate builtins section of the manual --- doc/manual/local.mk | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'doc/manual/local.mk') diff --git a/doc/manual/local.mk b/doc/manual/local.mk index dcc02d538..297a73414 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -32,15 +32,22 @@ $(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/generate-options.jq jq -r -f doc/manual/generate-options.jq $< >> $@ $(d)/nix.json: $(bindir)/nix - $(trace-gen) $(bindir)/nix dump-args > $@ + $(trace-gen) $(bindir)/nix __dump-args > $@ $(d)/conf-file.json: $(bindir)/nix $(trace-gen) env -i NIX_CONF_DIR=/dummy HOME=/dummy $(bindir)/nix show-config --json --experimental-features nix-command > $@ +$(d)/src/expressions/builtins.md: $(d)/builtins.json $(d)/generate-builtins.jq $(d)/src/expressions/builtins-prefix.md + cat doc/manual/src/expressions/builtins-prefix.md > $@ + jq -r -f doc/manual/generate-builtins.jq $< >> $@ + +$(d)/builtins.json: $(bindir)/nix + $(trace-gen) $(bindir)/nix __dump-builtins > $@ + # Generate the HTML manual. install: $(docdir)/manual/index.html -$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css +$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/custom.css $(d)/src/command-ref/nix.md $(d)/src/command-ref/conf-file.md $(d)/src/expressions/builtins.md $(trace-gen) mdbook build doc/manual -d $(docdir)/manual @cp doc/manual/highlight.pack.js $(docdir)/manual/highlight.js -- cgit v1.2.3