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