From 998b977ede9948f78a6a913ecedf3361eb14f769 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 6 Apr 2012 21:45:00 +0200 Subject: [PATCH] Include common options in the manpages using some XInclude hackery --- doc/manual/Makefile.am | 36 ++++++++++++++++++++++------------ doc/manual/nix-build.xml | 14 ++++++++----- doc/manual/nix-env.xml | 10 +++++++--- doc/manual/nix-instantiate.xml | 8 ++++++-- doc/manual/nix-store.xml | 9 +++++++-- doc/manual/opt-common.xml | 2 +- 6 files changed, 54 insertions(+), 25 deletions(-) diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am index 637d370c1..009496a8f 100644 --- a/doc/manual/Makefile.am +++ b/doc/manual/Makefile.am @@ -1,5 +1,5 @@ -XMLLINT = $(xmllint) $(xmlflags) -XSLTPROC = $(xsltproc) $(xmlflags) \ +XMLLINT = $(xmllint) --nonet $(xmlflags) +XSLTPROC = $(xsltproc) --nonet $(xmlflags) \ --param section.autolabel 1 \ --param section.label.includes.component.label 1 \ --param html.stylesheet \'style.css\' \ @@ -34,24 +34,36 @@ MANUAL_SRCS = manual.xml introduction.xml installation.xml \ conf-file.xml release-notes.xml \ style.css images +# Do XInclude processing. +manual.xmli: $(MANUAL_SRCS) version.txt + $(XMLLINT) --xinclude $< -o $@.tmp + mv $@.tmp $@ + # Note: RelaxNG validation requires xmllint >= 2.7.4. -manual.is-valid: $(MANUAL_SRCS) version.txt - $(XMLLINT) --noout --nonet --xinclude --noxincludenode --relaxng $(docbookrng)/docbook.rng $< +manual.is-valid: manual.xmli + $(XSLTPROC) --novalid --stringparam profile.condition manual \ + $(docbookxsl)/profiling/profile.xsl $< 2> /dev/null | \ + $(XMLLINT) --noout --relaxng $(docbookrng)/docbook.rng - touch $@ version.txt: echo -n $(VERSION) > version.txt -man $(MANS): $(MANUAL_SRCS) manual.is-valid - $(XSLTPROC) --nonet --xinclude $(docbookxsl)/manpages/docbook.xsl manual.xml +man $(MANS): manual.is-valid + $(XSLTPROC) --stringparam profile.condition manpage \ + $(docbookxsl)/profiling/profile.xsl manual.xmli 2> /dev/null | \ + $(XSLTPROC) $(docbookxsl)/manpages/docbook.xsl - manual.html: $(MANUAL_SRCS) manual.is-valid images - $(XSLTPROC) --nonet --xinclude --output manual.html \ - $(docbookxsl)/html/docbook.xsl manual.xml + $(XSLTPROC) --xinclude --stringparam profile.condition manual \ + $(docbookxsl)/profiling/profile.xsl manual.xml | \ + $(XSLTPROC) --output manual.html $(docbookxsl)/html/docbook.xsl - manual.pdf: $(MANUAL_SRCS) manual.is-valid images if test "$(dblatex)" != ""; then \ - $(dblatex) $(dblatex_opts) manual.xml; \ + $(XSLTPROC) --xinclude --stringparam profile.condition manual \ + $(docbookxsl)/profiling/profile.xsl manual.xml | \ + $(dblatex) -o manual.pdf $(dblatex_opts) -; \ else \ echo "Please install dblatex and rerun configure."; \ exit 1; \ @@ -64,12 +76,12 @@ NEWS_OPTS = \ --stringparam header.rule 0 NEWS.html: release-notes.xml - $(XSLTPROC) --nonet --xinclude --output $@ $(NEWS_OPTS) \ + $(XSLTPROC) --xinclude --output $@ $(NEWS_OPTS) \ $(docbookxsl)/html/docbook.xsl release-notes.xml NEWS.txt: release-notes.xml - $(XSLTPROC) --nonet --xinclude quote-literals.xsl release-notes.xml | \ - $(XSLTPROC) --nonet --output $@.tmp.html $(NEWS_OPTS) \ + $(XSLTPROC) --xinclude quote-literals.xsl release-notes.xml | \ + $(XSLTPROC) --output $@.tmp.html $(NEWS_OPTS) \ $(docbookxsl)/html/docbook.xsl - LANG=en_US $(w3m) -dump $@.tmp.html > $@ rm $@.tmp.html diff --git a/doc/manual/nix-build.xml b/doc/manual/nix-build.xml index 465635f67..1194f2962 100644 --- a/doc/manual/nix-build.xml +++ b/doc/manual/nix-build.xml @@ -75,11 +75,11 @@ or renamed. So don’t rename the symlink. Options -See also . All options not -listed here are passed to nix-store --realise, -except for and / - which are passed to -nix-instantiate. +All options not listed here are passed to nix-store +--realise, except for and + / which are passed to +nix-instantiate. See +also . @@ -122,6 +122,10 @@ except for and / + + + + diff --git a/doc/manual/nix-env.xml b/doc/manual/nix-env.xml index a03afaf5c..72c15b022 100644 --- a/doc/manual/nix-env.xml +++ b/doc/manual/nix-env.xml @@ -18,7 +18,7 @@ nix-env - + name value name value @@ -71,8 +71,8 @@ be performed. These are documented below. This section lists the options that are common to all operations. These options are allowed for every subcommand, though -they may not always have an effect. See also . +they may not always have an effect. See +also . @@ -131,6 +131,10 @@ linkend="sec-common-options" />. + + + + diff --git a/doc/manual/nix-instantiate.xml b/doc/manual/nix-instantiate.xml index ba89af425..b213535ff 100644 --- a/doc/manual/nix-instantiate.xml +++ b/doc/manual/nix-instantiate.xml @@ -64,8 +64,8 @@ store derivation instantiation from Nix expressions automatically). It is most commonly used for implementing new deployment policies. -See also for a list of -common options. +See also for a list of common options. @@ -127,6 +127,10 @@ common options. + + + + diff --git a/doc/manual/nix-store.xml b/doc/manual/nix-store.xml index aaacb7cfb..0c235c688 100644 --- a/doc/manual/nix-store.xml +++ b/doc/manual/nix-store.xml @@ -48,8 +48,9 @@ be performed. These are documented below. This section lists the options that are common to all operations. These options are allowed for every subcommand, though -they may not always have an effect. See also for a list of common options. +they may not always have an effect. See +also for a list of common +options. @@ -112,6 +113,10 @@ lrwxrwxrwx 1 ... 2005-03-13 21:10 /home/eelco/bla/result -> /nix/store/1r1134 + + + + diff --git a/doc/manual/opt-common.xml b/doc/manual/opt-common.xml index c36c6df41..92b76c01f 100644 --- a/doc/manual/opt-common.xml +++ b/doc/manual/opt-common.xml @@ -5,7 +5,7 @@ Most Nix commands accept the following command-line options: - +