diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-07-22 20:27:23 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-07-23 18:26:48 +0200 |
commit | e0ea3c82ca9e46359c55c9f716fec016f8d483ea (patch) | |
tree | 5c538cd5c0ad0912268039079540019b0bc113a3 /doc/manual | |
parent | 650ae14ceda72dcb294bde4d08988a7ed26ab0ff (diff) |
Use mdbook
Diffstat (limited to 'doc/manual')
-rw-r--r-- | doc/manual/local.mk | 81 | ||||
-rw-r--r-- | doc/manual/src/SUMMARY.md | 7 | ||||
-rw-r--r-- | doc/manual/src/command-ref/command-ref.md | 2 | ||||
-rw-r--r-- | doc/manual/src/command-ref/nix-copy-closure.md (renamed from doc/manual/command-ref/nix-copy-closure.md) | 0 | ||||
-rw-r--r-- | doc/manual/src/command-ref/utilities.md | 3 | ||||
-rw-r--r-- | doc/manual/src/introduction.md (renamed from doc/manual/introduction/about-nix.md) | 2 | ||||
-rw-r--r-- | doc/manual/src/quick-start.md (renamed from doc/manual/introduction/quick-start.md) | 0 |
7 files changed, 31 insertions, 64 deletions
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 diff --git a/doc/manual/src/SUMMARY.md b/doc/manual/src/SUMMARY.md new file mode 100644 index 000000000..6897f70d9 --- /dev/null +++ b/doc/manual/src/SUMMARY.md @@ -0,0 +1,7 @@ +# Table of Contents + +- [Introduction](./introduction.md) +- [Quick Start](./quick-start.md) +- [Command Reference](./command-ref/command-ref.md) + - [Utilities](./command-ref/utilities.md) + - [nix-copy-closure](./command-ref/nix-copy-closure.md) diff --git a/doc/manual/src/command-ref/command-ref.md b/doc/manual/src/command-ref/command-ref.md new file mode 100644 index 000000000..b15a50a3b --- /dev/null +++ b/doc/manual/src/command-ref/command-ref.md @@ -0,0 +1,2 @@ +This section lists commands and options that you can use when you +work with Nix. diff --git a/doc/manual/command-ref/nix-copy-closure.md b/doc/manual/src/command-ref/nix-copy-closure.md index 037334c4d..037334c4d 100644 --- a/doc/manual/command-ref/nix-copy-closure.md +++ b/doc/manual/src/command-ref/nix-copy-closure.md diff --git a/doc/manual/src/command-ref/utilities.md b/doc/manual/src/command-ref/utilities.md new file mode 100644 index 000000000..5ba8a02a3 --- /dev/null +++ b/doc/manual/src/command-ref/utilities.md @@ -0,0 +1,3 @@ +# Utilities + +This section lists utilities that you can use when you work with Nix. diff --git a/doc/manual/introduction/about-nix.md b/doc/manual/src/introduction.md index b3cd00bd3..b54b0d02d 100644 --- a/doc/manual/introduction/about-nix.md +++ b/doc/manual/src/introduction.md @@ -1,4 +1,4 @@ -# About Nix +# Introduction Nix is a _purely functional package manager_. This means that it treats packages like values in purely functional programming languages diff --git a/doc/manual/introduction/quick-start.md b/doc/manual/src/quick-start.md index 21c03e3cf..21c03e3cf 100644 --- a/doc/manual/introduction/quick-start.md +++ b/doc/manual/src/quick-start.md |