doc: move parameters to an XML file

+40 -19
+4 -4
doc/Makefile
··· 30 30 31 31 out/html/index.html: doc-support/result manual-full.xml style.css highlightjs 32 32 mkdir -p out/html 33 - xsltproc ${xsltFlags} \ 33 + xsltproc \ 34 34 --nonet --xinclude \ 35 35 --output $@ \ 36 - doc-support/result/xsl/docbook/xhtml/docbook.xsl \ 36 + doc-support/result/xhtml.xsl \ 37 37 ./manual-full.xml 38 38 39 39 mkdir -p out/html/highlightjs/ ··· 48 48 49 49 out/epub/manual.epub: manual-full.xml 50 50 mkdir -p out/epub/scratch 51 - xsltproc ${xsltFlags} --nonet \ 51 + xsltproc --nonet \ 52 52 --output out/epub/scratch/ \ 53 - doc-support/result/xsl/docbook/epub/docbook.xsl \ 53 + doc-support/result/epub.xsl \ 54 54 ./manual-full.xml 55 55 56 56 cp ./overrides.css out/epub/scratch/OEBPS
-15
doc/default.nix
··· 9 9 10 10 src = ./.; 11 11 12 - # Hacking on these variables? Make sure to close and open 13 - # nix-shell between each test, maybe even: 14 - # $ nix-shell --run "make clean all" 15 - # otherwise they won't reapply :) 16 - xsltFlags = lib.concatStringsSep " " [ 17 - "--param section.autolabel 1" 18 - "--param section.label.includes.component.label 1" 19 - "--stringparam html.stylesheet 'style.css overrides.css highlightjs/mono-blue.css'" 20 - "--stringparam html.script './highlightjs/highlight.pack.js ./highlightjs/loader.js'" 21 - "--param xref.with.number.and.title 1" 22 - "--param toc.section.depth 3" 23 - "--stringparam admon.style ''" 24 - "--stringparam callout.graphics.extension .svg" 25 - ]; 26 - 27 12 postPatch = '' 28 13 ln -s ${doc-support} ./doc-support/result 29 14 '';
+22
doc/doc-support/default.nix
··· 3 3 locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; }; 4 4 functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; }; 5 5 version = pkgs.lib.version; 6 + 7 + epub-xsl = pkgs.writeText "epub.xsl" '' 8 + <?xml version='1.0'?> 9 + <xsl:stylesheet 10 + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 11 + version="1.0"> 12 + <xsl:import href="${pkgs.docbook_xsl_ns}/xml/xsl/docbook/epub/docbook.xsl" /> 13 + <xsl:import href="${./parameters.xml}"/> 14 + </xsl:stylesheet> 15 + ''; 16 + 17 + xhtml-xsl = pkgs.writeText "xhtml.xsl" '' 18 + <?xml version='1.0'?> 19 + <xsl:stylesheet 20 + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 21 + version="1.0"> 22 + <xsl:import href="${pkgs.docbook_xsl_ns}/xml/xsl/docbook/xhtml/docbook.xsl" /> 23 + <xsl:import href="${./parameters.xml}"/> 24 + </xsl:stylesheet> 25 + ''; 6 26 in pkgs.runCommand "doc-support" {} 7 27 '' 8 28 mkdir result ··· 13 33 14 34 ln -s ${pkgs.docbook5}/xml/rng/docbook/docbook.rng ./docbook.rng 15 35 ln -s ${pkgs.docbook_xsl_ns}/xml/xsl ./xsl 36 + ln -s ${epub-xsl} ./epub.xsl 37 + ln -s ${xhtml-xsl} ./xhtml.xsl 16 38 17 39 ln -s ${../../nixos/doc/xmlformat.conf} ./xmlformat.conf 18 40 ln -s ${pkgs.documentation-highlighter} ./highlightjs
+14
doc/doc-support/parameters.xml
··· 1 + <?xml version='1.0'?> 2 + <xsl:stylesheet 3 + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 + version="1.0"> 5 + <xsl:param name="section.autolabel" select="1" /> 6 + <xsl:param name="section.label.includes.component.label" select="1" /> 7 + <xsl:param name="html.stylesheet" select="'style.css overrides.css highlightjs/mono-blue.css'" /> 8 + <xsl:param name="html.script" select="'./highlightjs/highlight.pack.js ./highlightjs/loader.js'" /> 9 + <xsl:param name="xref.with.number.and.title" select="1" /> 10 + <xsl:param name="use.id.as.filename" select="1" /> 11 + <xsl:param name="toc.section.depth" select="3" /> 12 + <xsl:param name="admon.style" select="''" /> 13 + <xsl:param name="callout.graphics.extension" select="'.svg'" /> 14 + </xsl:stylesheet>