2016-03-01 19:47:08 +00:00
|
|
|
{ pkgs, options, version, revision, extraSources ? [] }:
|
2008-06-05 16:33:17 +01:00
|
|
|
|
2014-08-09 15:30:44 +01:00
|
|
|
with pkgs;
|
2013-10-17 13:09:05 +01:00
|
|
|
|
2011-09-14 19:20:50 +01:00
|
|
|
let
|
2016-07-28 03:27:39 +01:00
|
|
|
lib = pkgs.lib;
|
2009-10-06 00:15:06 +01:00
|
|
|
|
2013-10-23 18:32:19 +01:00
|
|
|
# Remove invisible and internal options.
|
2016-07-28 03:27:39 +01:00
|
|
|
optionsList = lib.filter (opt: opt.visible && !opt.internal) (lib.optionAttrSetToDocList options);
|
2014-08-27 10:53:08 +01:00
|
|
|
|
|
|
|
# Replace functions by the string <function>
|
|
|
|
substFunction = x:
|
2016-07-28 03:27:39 +01:00
|
|
|
if builtins.isAttrs x then lib.mapAttrs (name: substFunction) x
|
2014-08-27 10:53:08 +01:00
|
|
|
else if builtins.isList x then map substFunction x
|
|
|
|
else if builtins.isFunction x then "<function>"
|
|
|
|
else x;
|
2013-10-23 18:32:19 +01:00
|
|
|
|
|
|
|
# Clean up declaration sites to not refer to the NixOS source tree.
|
2016-07-28 03:27:39 +01:00
|
|
|
optionsList' = lib.flip map optionsList (opt: opt // {
|
2016-01-29 15:20:22 +00:00
|
|
|
declarations = map stripAnyPrefixes opt.declarations;
|
2014-08-27 10:53:08 +01:00
|
|
|
}
|
2016-07-28 03:27:39 +01:00
|
|
|
// lib.optionalAttrs (opt ? example) { example = substFunction opt.example; }
|
|
|
|
// lib.optionalAttrs (opt ? default) { default = substFunction opt.default; }
|
|
|
|
// lib.optionalAttrs (opt ? type) { type = substFunction opt.type; });
|
2013-10-23 18:32:19 +01:00
|
|
|
|
2016-01-22 19:22:12 +00:00
|
|
|
# We need to strip references to /nix/store/* from options,
|
|
|
|
# including any `extraSources` if some modules came from elsewhere,
|
|
|
|
# or else the build will fail.
|
|
|
|
#
|
|
|
|
# E.g. if some `options` came from modules in ${pkgs.customModules}/nix,
|
2016-01-29 15:20:22 +00:00
|
|
|
# you'd need to include `extraSources = [ pkgs.customModules ]`
|
2016-01-29 18:34:00 +00:00
|
|
|
prefixesToStrip = map (p: "${toString p}/") ([ ../../.. ] ++ extraSources);
|
2016-07-28 03:27:39 +01:00
|
|
|
stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) prefixesToStrip;
|
2013-10-23 18:32:19 +01:00
|
|
|
|
2015-09-24 10:47:00 +01:00
|
|
|
# Convert the list of options into an XML file.
|
|
|
|
optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList');
|
2008-01-04 14:24:42 +00:00
|
|
|
|
2014-08-09 15:30:44 +01:00
|
|
|
optionsDocBook = runCommand "options-db.xml" {} ''
|
2014-11-17 12:41:18 +00:00
|
|
|
optionsXML=${optionsXML}
|
2014-08-27 10:53:08 +01:00
|
|
|
if grep /nixpkgs/nixos/modules $optionsXML; then
|
2013-10-23 19:06:17 +01:00
|
|
|
echo "The manual appears to depend on the location of Nixpkgs, which is bad"
|
|
|
|
echo "since this prevents sharing via the NixOS channel. This is typically"
|
|
|
|
echo "caused by an option default that refers to a relative path (see above"
|
|
|
|
echo "for hints about the offending path)."
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-10-05 12:23:01 +01:00
|
|
|
${libxslt.bin}/bin/xsltproc \
|
2009-10-06 00:47:50 +01:00
|
|
|
--stringparam revision '${revision}' \
|
2014-08-27 10:53:08 +01:00
|
|
|
-o $out ${./options-to-docbook.xsl} $optionsXML
|
2008-01-04 14:24:42 +00:00
|
|
|
'';
|
2009-09-18 16:10:37 +01:00
|
|
|
|
2016-07-28 03:27:39 +01:00
|
|
|
sources = lib.sourceFilesBySuffices ./. [".xml"];
|
2014-08-25 13:33:17 +01:00
|
|
|
|
|
|
|
copySources =
|
|
|
|
''
|
|
|
|
cp -prd $sources/* . # */
|
2014-08-27 11:24:10 +01:00
|
|
|
chmod -R u+w .
|
|
|
|
cp ${../../modules/services/databases/postgresql.xml} configuration/postgresql.xml
|
2016-02-26 07:31:58 +00:00
|
|
|
cp ${../../modules/services/misc/gitlab.xml} configuration/gitlab.xml
|
2016-04-07 13:11:49 +01:00
|
|
|
cp ${../../modules/services/misc/taskserver/doc.xml} configuration/taskserver.xml
|
2015-12-12 15:06:24 +00:00
|
|
|
cp ${../../modules/security/acme.xml} configuration/acme.xml
|
2016-04-12 11:46:12 +01:00
|
|
|
cp ${../../modules/i18n/input-method/default.xml} configuration/input-methods.xml
|
2014-08-25 13:33:17 +01:00
|
|
|
ln -s ${optionsDocBook} options-db.xml
|
|
|
|
echo "${version}" > version
|
|
|
|
'';
|
|
|
|
|
2015-07-22 15:09:00 +01:00
|
|
|
toc = builtins.toFile "toc.xml"
|
|
|
|
''
|
|
|
|
<toc role="chunk-toc">
|
|
|
|
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-nixos-manual"><?dbhtml filename="index.html"?>
|
2015-07-22 15:17:06 +01:00
|
|
|
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
|
|
|
|
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
|
2015-07-22 15:09:00 +01:00
|
|
|
</d:tocentry>
|
|
|
|
</toc>
|
|
|
|
'';
|
|
|
|
|
nixos/doc: Allow refs from options to the manual
My first attempt to do this was to just use a conditional <refsection/>
in order to not create exact references in the manpage but create the
reference in the HTML manual, as suggested by @edolstra on IRC.
Later I went on to use <olink/> to reference sections of the manual, but
in order to do that, we need to overhaul how we generate the manual and
manpages.
So, that's where we are now:
There is a new derivation called "manual-olinkdb", which is the olinkdb
for the HTML manual, which in turn creates the olinkdb.xml file and the
manual.db. The former contains the targetdoc references and the latter
the specific targetptr elements.
The reason why I included the olinkdb.xml verbatim is that first of all
the DTD is dependent on the Docbook XSL sources and the references
within the olinkdb.xml entities are relative to the current directory.
So using a store path for that would end up searching for the manual.db
directly in /nix/store/manual.db.
Unfortunately, the <olinks/> that end up in the output file are
relative, so for example if you're clicking on one of these within the
PDF, the URL is searched in the current directory.
However, the sections from the olink's text are still valid, so we could
use an alternative URL for that in the future.
The manual doesn't contain any links, so even referencing the relative
URL shouldn't do any harm.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @edolstra
2016-04-11 17:29:00 +01:00
|
|
|
manualXsltprocOptions = toString [
|
|
|
|
"--param section.autolabel 1"
|
|
|
|
"--param section.label.includes.component.label 1"
|
|
|
|
"--stringparam html.stylesheet style.css"
|
|
|
|
"--param xref.with.number.and.title 1"
|
|
|
|
"--param toc.section.depth 3"
|
|
|
|
"--stringparam admon.style ''"
|
|
|
|
"--stringparam callout.graphics.extension .gif"
|
|
|
|
"--stringparam current.docid manual"
|
|
|
|
"--param chunk.section.depth 0"
|
|
|
|
"--param chunk.first.sections 1"
|
|
|
|
"--param use.id.as.filename 1"
|
|
|
|
"--stringparam generate.toc 'book toc appendix toc'"
|
|
|
|
"--stringparam chunk.toc ${toc}"
|
|
|
|
];
|
|
|
|
|
|
|
|
olinkDB = stdenv.mkDerivation {
|
|
|
|
name = "manual-olinkdb";
|
|
|
|
|
|
|
|
inherit sources;
|
|
|
|
|
|
|
|
buildInputs = [ libxml2 libxslt ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
${copySources}
|
|
|
|
|
|
|
|
xsltproc \
|
|
|
|
${manualXsltprocOptions} \
|
|
|
|
--stringparam collect.xref.targets only \
|
|
|
|
--stringparam targets.filename "$out/manual.db" \
|
|
|
|
--nonet --xinclude \
|
|
|
|
${docbook5_xsl}/xml/xsl/docbook/xhtml/chunktoc.xsl \
|
|
|
|
./manual.xml
|
|
|
|
|
|
|
|
# Check the validity of the man pages sources.
|
|
|
|
xmllint --noout --nonet --xinclude --noxincludenode \
|
|
|
|
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
|
|
|
|
./man-pages.xml
|
|
|
|
|
|
|
|
cat > "$out/olinkdb.xml" <<EOF
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<!DOCTYPE targetset SYSTEM
|
|
|
|
"file://${docbook5_xsl}/xml/xsl/docbook/common/targetdatabase.dtd" [
|
|
|
|
<!ENTITY manualtargets SYSTEM "file://$out/manual.db">
|
|
|
|
]>
|
|
|
|
<targetset>
|
|
|
|
<targetsetinfo>
|
|
|
|
Allows for cross-referencing olinks between the manpages
|
|
|
|
and the HTML/PDF manuals.
|
|
|
|
</targetsetinfo>
|
|
|
|
|
|
|
|
<document targetdoc="manual">&manualtargets;</document>
|
|
|
|
</targetset>
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2010-08-11 13:28:53 +01:00
|
|
|
in rec {
|
|
|
|
|
2014-11-17 12:41:18 +00:00
|
|
|
# The NixOS options in JSON format.
|
|
|
|
optionsJSON = stdenv.mkDerivation {
|
|
|
|
name = "options-json";
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
# Export list of options in different format.
|
|
|
|
dst=$out/share/doc/nixos
|
|
|
|
mkdir -p $dst
|
|
|
|
|
2014-11-17 12:44:52 +00:00
|
|
|
cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON
|
2016-07-28 03:27:39 +01:00
|
|
|
(builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList'))))
|
2014-11-17 12:44:52 +00:00
|
|
|
} $dst/options.json
|
2014-11-17 12:41:18 +00:00
|
|
|
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
|
|
|
|
''; # */
|
|
|
|
|
|
|
|
meta.description = "List of NixOS options in JSON format";
|
|
|
|
};
|
2014-08-27 10:53:08 +01:00
|
|
|
|
2010-08-11 13:28:53 +01:00
|
|
|
# Generate the NixOS manual.
|
2014-08-09 15:30:44 +01:00
|
|
|
manual = stdenv.mkDerivation {
|
2008-01-04 14:24:42 +00:00
|
|
|
name = "nixos-manual";
|
|
|
|
|
2014-08-25 13:33:17 +01:00
|
|
|
inherit sources;
|
2008-01-04 14:24:42 +00:00
|
|
|
|
2014-08-09 15:30:44 +01:00
|
|
|
buildInputs = [ libxml2 libxslt ];
|
2008-01-04 14:24:42 +00:00
|
|
|
|
|
|
|
buildCommand = ''
|
2014-08-25 13:33:17 +01:00
|
|
|
${copySources}
|
2009-07-14 16:47:03 +01:00
|
|
|
|
2009-10-05 14:17:45 +01:00
|
|
|
# Check the validity of the manual sources.
|
|
|
|
xmllint --noout --nonet --xinclude --noxincludenode \
|
2014-08-09 15:30:44 +01:00
|
|
|
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
|
2009-10-05 14:17:45 +01:00
|
|
|
manual.xml
|
|
|
|
|
|
|
|
# Generate the HTML manual.
|
2009-07-14 16:47:03 +01:00
|
|
|
dst=$out/share/doc/nixos
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $dst
|
2014-08-25 18:08:12 +01:00
|
|
|
xsltproc \
|
nixos/doc: Allow refs from options to the manual
My first attempt to do this was to just use a conditional <refsection/>
in order to not create exact references in the manpage but create the
reference in the HTML manual, as suggested by @edolstra on IRC.
Later I went on to use <olink/> to reference sections of the manual, but
in order to do that, we need to overhaul how we generate the manual and
manpages.
So, that's where we are now:
There is a new derivation called "manual-olinkdb", which is the olinkdb
for the HTML manual, which in turn creates the olinkdb.xml file and the
manual.db. The former contains the targetdoc references and the latter
the specific targetptr elements.
The reason why I included the olinkdb.xml verbatim is that first of all
the DTD is dependent on the Docbook XSL sources and the references
within the olinkdb.xml entities are relative to the current directory.
So using a store path for that would end up searching for the manual.db
directly in /nix/store/manual.db.
Unfortunately, the <olinks/> that end up in the output file are
relative, so for example if you're clicking on one of these within the
PDF, the URL is searched in the current directory.
However, the sections from the olink's text are still valid, so we could
use an alternative URL for that in the future.
The manual doesn't contain any links, so even referencing the relative
URL shouldn't do any harm.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @edolstra
2016-04-11 17:29:00 +01:00
|
|
|
${manualXsltprocOptions} \
|
|
|
|
--stringparam target.database.document "${olinkDB}/olinkdb.xml" \
|
2014-08-25 18:08:12 +01:00
|
|
|
--nonet --xinclude --output $dst/ \
|
2015-07-22 15:09:00 +01:00
|
|
|
${docbook5_xsl}/xml/xsl/docbook/xhtml/chunktoc.xsl ./manual.xml
|
2009-09-18 16:10:37 +01:00
|
|
|
|
2012-07-25 16:54:24 +01:00
|
|
|
mkdir -p $dst/images/callouts
|
2014-08-09 15:30:44 +01:00
|
|
|
cp ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/images/callouts/
|
2013-01-09 12:43:57 +00:00
|
|
|
|
2009-07-14 16:47:03 +01:00
|
|
|
cp ${./style.css} $dst/style.css
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2013-10-24 19:06:02 +01:00
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "nix-build out $out" >> $out/nix-support/hydra-build-products
|
2014-09-10 14:03:49 +01:00
|
|
|
echo "doc manual $dst" >> $out/nix-support/hydra-build-products
|
2012-07-25 16:54:24 +01:00
|
|
|
''; # */
|
2013-10-24 19:06:02 +01:00
|
|
|
|
|
|
|
meta.description = "The NixOS manual in HTML format";
|
2015-09-24 10:47:00 +01:00
|
|
|
|
|
|
|
allowedReferences = ["out"];
|
2010-08-11 13:28:53 +01:00
|
|
|
};
|
|
|
|
|
2016-07-28 03:27:39 +01:00
|
|
|
|
|
|
|
manualEpub = stdenv.mkDerivation {
|
|
|
|
name = "nixos-manual-epub";
|
|
|
|
|
|
|
|
inherit sources;
|
|
|
|
|
|
|
|
buildInputs = [ libxml2 libxslt zip ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
${copySources}
|
|
|
|
|
|
|
|
# Check the validity of the manual sources.
|
|
|
|
xmllint --noout --nonet --xinclude --noxincludenode \
|
|
|
|
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
|
|
|
|
manual.xml
|
|
|
|
|
|
|
|
# Generate the epub manual.
|
|
|
|
dst=$out/share/doc/nixos
|
|
|
|
|
|
|
|
xsltproc \
|
|
|
|
${manualXsltprocOptions} \
|
|
|
|
--stringparam target.database.document "${olinkDB}/olinkdb.xml" \
|
|
|
|
--nonet --xinclude --output $dst/epub/ \
|
|
|
|
${docbook5_xsl}/xml/xsl/docbook/epub/docbook.xsl ./manual.xml
|
|
|
|
|
|
|
|
mkdir -p $dst/epub/OEBPS/images/callouts
|
|
|
|
cp -r ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/epub/OEBPS/images/callouts
|
|
|
|
echo "application/epub+zip" > mimetype
|
|
|
|
zip -0Xq "$dst/NixOS Manual - NixOS community.epub" mimetype
|
|
|
|
zip -Xr9D "$dst/NixOS Manual - NixOS community.epub" $dst/epub/*
|
|
|
|
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "doc-epub manual $dst/NixOS Manual - NixOS community.epub" >> $out/nix-support/hydra-build-products
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-08-09 15:30:44 +01:00
|
|
|
manualPDF = stdenv.mkDerivation {
|
|
|
|
name = "nixos-manual-pdf";
|
|
|
|
|
2014-08-25 13:33:17 +01:00
|
|
|
inherit sources;
|
2014-08-09 15:30:44 +01:00
|
|
|
|
2015-09-23 19:51:03 +01:00
|
|
|
buildInputs = [ libxml2 libxslt dblatex dblatex.tex ];
|
2014-08-09 15:30:44 +01:00
|
|
|
|
|
|
|
buildCommand = ''
|
2014-08-25 13:33:17 +01:00
|
|
|
${copySources}
|
2014-08-09 15:30:44 +01:00
|
|
|
|
|
|
|
dst=$out/share/doc/nixos
|
|
|
|
mkdir -p $dst
|
|
|
|
xmllint --xinclude manual.xml | dblatex -o $dst/manual.pdf - \
|
nixos/doc: Allow refs from options to the manual
My first attempt to do this was to just use a conditional <refsection/>
in order to not create exact references in the manpage but create the
reference in the HTML manual, as suggested by @edolstra on IRC.
Later I went on to use <olink/> to reference sections of the manual, but
in order to do that, we need to overhaul how we generate the manual and
manpages.
So, that's where we are now:
There is a new derivation called "manual-olinkdb", which is the olinkdb
for the HTML manual, which in turn creates the olinkdb.xml file and the
manual.db. The former contains the targetdoc references and the latter
the specific targetptr elements.
The reason why I included the olinkdb.xml verbatim is that first of all
the DTD is dependent on the Docbook XSL sources and the references
within the olinkdb.xml entities are relative to the current directory.
So using a store path for that would end up searching for the manual.db
directly in /nix/store/manual.db.
Unfortunately, the <olinks/> that end up in the output file are
relative, so for example if you're clicking on one of these within the
PDF, the URL is searched in the current directory.
However, the sections from the olink's text are still valid, so we could
use an alternative URL for that in the future.
The manual doesn't contain any links, so even referencing the relative
URL shouldn't do any harm.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @edolstra
2016-04-11 17:29:00 +01:00
|
|
|
-P target.database.document="${olinkDB}/olinkdb.xml" \
|
2014-08-09 15:30:44 +01:00
|
|
|
-P doc.collab.show=0 \
|
|
|
|
-P latex.output.revhistory=0
|
|
|
|
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "doc-pdf manual $dst/manual.pdf" >> $out/nix-support/hydra-build-products
|
2015-09-23 19:51:03 +01:00
|
|
|
'';
|
2014-08-09 15:30:44 +01:00
|
|
|
};
|
|
|
|
|
2010-08-11 13:28:53 +01:00
|
|
|
# Generate the NixOS manpages.
|
2014-08-09 15:30:44 +01:00
|
|
|
manpages = stdenv.mkDerivation {
|
2010-08-11 13:28:53 +01:00
|
|
|
name = "nixos-manpages";
|
|
|
|
|
2014-08-25 13:33:17 +01:00
|
|
|
inherit sources;
|
2010-08-11 13:28:53 +01:00
|
|
|
|
2014-08-09 15:30:44 +01:00
|
|
|
buildInputs = [ libxml2 libxslt ];
|
2010-08-11 13:28:53 +01:00
|
|
|
|
|
|
|
buildCommand = ''
|
2014-08-25 13:33:17 +01:00
|
|
|
${copySources}
|
2010-08-11 13:28:53 +01:00
|
|
|
|
nixos/doc: Allow refs from options to the manual
My first attempt to do this was to just use a conditional <refsection/>
in order to not create exact references in the manpage but create the
reference in the HTML manual, as suggested by @edolstra on IRC.
Later I went on to use <olink/> to reference sections of the manual, but
in order to do that, we need to overhaul how we generate the manual and
manpages.
So, that's where we are now:
There is a new derivation called "manual-olinkdb", which is the olinkdb
for the HTML manual, which in turn creates the olinkdb.xml file and the
manual.db. The former contains the targetdoc references and the latter
the specific targetptr elements.
The reason why I included the olinkdb.xml verbatim is that first of all
the DTD is dependent on the Docbook XSL sources and the references
within the olinkdb.xml entities are relative to the current directory.
So using a store path for that would end up searching for the manual.db
directly in /nix/store/manual.db.
Unfortunately, the <olinks/> that end up in the output file are
relative, so for example if you're clicking on one of these within the
PDF, the URL is searched in the current directory.
However, the sections from the olink's text are still valid, so we could
use an alternative URL for that in the future.
The manual doesn't contain any links, so even referencing the relative
URL shouldn't do any harm.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @edolstra
2016-04-11 17:29:00 +01:00
|
|
|
# Check the validity of the man pages sources.
|
2010-08-11 13:28:53 +01:00
|
|
|
xmllint --noout --nonet --xinclude --noxincludenode \
|
2014-08-09 15:30:44 +01:00
|
|
|
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
|
2010-08-11 13:28:53 +01:00
|
|
|
./man-pages.xml
|
2009-07-14 16:47:03 +01:00
|
|
|
|
2009-10-05 14:17:45 +01:00
|
|
|
# Generate manpages.
|
2013-10-24 19:06:02 +01:00
|
|
|
mkdir -p $out/share/man
|
2009-07-14 16:47:03 +01:00
|
|
|
xsltproc --nonet --xinclude \
|
|
|
|
--param man.output.in.separate.dir 1 \
|
|
|
|
--param man.output.base.dir "'$out/share/man/'" \
|
2009-10-06 00:15:06 +01:00
|
|
|
--param man.endnotes.are.numbered 0 \
|
2016-03-19 16:16:59 +00:00
|
|
|
--param man.break.after.slash 1 \
|
nixos/doc: Allow refs from options to the manual
My first attempt to do this was to just use a conditional <refsection/>
in order to not create exact references in the manpage but create the
reference in the HTML manual, as suggested by @edolstra on IRC.
Later I went on to use <olink/> to reference sections of the manual, but
in order to do that, we need to overhaul how we generate the manual and
manpages.
So, that's where we are now:
There is a new derivation called "manual-olinkdb", which is the olinkdb
for the HTML manual, which in turn creates the olinkdb.xml file and the
manual.db. The former contains the targetdoc references and the latter
the specific targetptr elements.
The reason why I included the olinkdb.xml verbatim is that first of all
the DTD is dependent on the Docbook XSL sources and the references
within the olinkdb.xml entities are relative to the current directory.
So using a store path for that would end up searching for the manual.db
directly in /nix/store/manual.db.
Unfortunately, the <olinks/> that end up in the output file are
relative, so for example if you're clicking on one of these within the
PDF, the URL is searched in the current directory.
However, the sections from the olink's text are still valid, so we could
use an alternative URL for that in the future.
The manual doesn't contain any links, so even referencing the relative
URL shouldn't do any harm.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @edolstra
2016-04-11 17:29:00 +01:00
|
|
|
--stringparam target.database.document "${olinkDB}/olinkdb.xml" \
|
2014-08-09 15:30:44 +01:00
|
|
|
${docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
|
2009-07-14 16:47:03 +01:00
|
|
|
./man-pages.xml
|
2008-01-04 14:24:42 +00:00
|
|
|
'';
|
2015-09-24 10:47:00 +01:00
|
|
|
|
|
|
|
allowedReferences = ["out"];
|
2008-01-04 14:24:42 +00:00
|
|
|
};
|
|
|
|
|
2011-09-14 19:20:50 +01:00
|
|
|
}
|