1{ pkgs ? (import ../.. {}), nixpkgs ? { }}:
2let
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 '';
26in pkgs.runCommand "doc-support" {}
27''
28 mkdir result
29 (
30 cd result
31 ln -s ${locationsXml} ./function-locations.xml
32 ln -s ${functionDocs} ./function-docs
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
41
42 echo -n "${version}" > ./version
43 )
44 mv result $out
45''