tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
doc: move parameters to an XML file
Graham Christensen
6 years ago
fa47df61
5a0696f6
+40
-19
4 changed files
expand all
collapse all
unified
split
doc
Makefile
default.nix
doc-support
default.nix
parameters.xml
+4
-4
doc/Makefile
···
30
31
out/html/index.html: doc-support/result manual-full.xml style.css highlightjs
32
mkdir -p out/html
33
-
xsltproc ${xsltFlags} \
34
--nonet --xinclude \
35
--output $@ \
36
-
doc-support/result/xsl/docbook/xhtml/docbook.xsl \
37
./manual-full.xml
38
39
mkdir -p out/html/highlightjs/
···
48
49
out/epub/manual.epub: manual-full.xml
50
mkdir -p out/epub/scratch
51
-
xsltproc ${xsltFlags} --nonet \
52
--output out/epub/scratch/ \
53
-
doc-support/result/xsl/docbook/epub/docbook.xsl \
54
./manual-full.xml
55
56
cp ./overrides.css out/epub/scratch/OEBPS
···
30
31
out/html/index.html: doc-support/result manual-full.xml style.css highlightjs
32
mkdir -p out/html
33
+
xsltproc \
34
--nonet --xinclude \
35
--output $@ \
36
+
doc-support/result/xhtml.xsl \
37
./manual-full.xml
38
39
mkdir -p out/html/highlightjs/
···
48
49
out/epub/manual.epub: manual-full.xml
50
mkdir -p out/epub/scratch
51
+
xsltproc --nonet \
52
--output out/epub/scratch/ \
53
+
doc-support/result/epub.xsl \
54
./manual-full.xml
55
56
cp ./overrides.css out/epub/scratch/OEBPS
-15
doc/default.nix
···
9
10
src = ./.;
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
postPatch = ''
28
ln -s ${doc-support} ./doc-support/result
29
'';
···
9
10
src = ./.;
11
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
12
postPatch = ''
13
ln -s ${doc-support} ./doc-support/result
14
'';
+22
doc/doc-support/default.nix
···
3
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
4
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
5
version = pkgs.lib.version;
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
6
in pkgs.runCommand "doc-support" {}
7
''
8
mkdir result
···
13
14
ln -s ${pkgs.docbook5}/xml/rng/docbook/docbook.rng ./docbook.rng
15
ln -s ${pkgs.docbook_xsl_ns}/xml/xsl ./xsl
0
0
16
17
ln -s ${../../nixos/doc/xmlformat.conf} ./xmlformat.conf
18
ln -s ${pkgs.documentation-highlighter} ./highlightjs
···
3
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
4
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
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
+
'';
26
in pkgs.runCommand "doc-support" {}
27
''
28
mkdir result
···
33
34
ln -s ${pkgs.docbook5}/xml/rng/docbook/docbook.rng ./docbook.rng
35
ln -s ${pkgs.docbook_xsl_ns}/xml/xsl ./xsl
36
+
ln -s ${epub-xsl} ./epub.xsl
37
+
ln -s ${xhtml-xsl} ./xhtml.xsl
38
39
ln -s ${../../nixos/doc/xmlformat.conf} ./xmlformat.conf
40
ln -s ${pkgs.documentation-highlighter} ./highlightjs
+14
doc/doc-support/parameters.xml
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
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>