3
0
Fork 0
forked from mirrors/nixpkgs

* Generate valid DocBook. <emphasis> isn't allowed in a <filename>.

* For manpage generation, work around a bug in the DocBook XSL
  stylesheet by using a <simplelist> instead of a <itemizedlist>
  (which is arguably better anyway).  The indentation of an
  <itemizedlist> lasts beyond the end of that element under certain
  circumstances, it seems.

* Disable the man.endnotes.are.numbered option to prevent endnotes to
  be generated for each xlink:href in the Declarations/Definitions
  lists (which we don't want anyway, I guess).  This causes libxslt to
  get stuck in an infinite (?) loop.

svn path=/nixos/trunk/; revision=17659
This commit is contained in:
Eelco Dolstra 2009-10-05 23:15:06 +00:00
parent 7e72788a39
commit 6b3b22537e
3 changed files with 16 additions and 13 deletions

View file

@ -4,6 +4,7 @@
}:
let
# To prevent infinite recursion, remove system.path from the
# options. Not sure why this happens.
options_ =
@ -33,7 +34,7 @@ let
'';
optionsDocBook = pkgs.runCommand "options-db.xml" {} ''
${pkgs.libxslt}/bin/xsltproc -o $out ${./options-to-docbook.xsl} ${optionsXML}
${pkgs.libxslt}/bin/xsltproc -o $out ${./options-to-docbook.xsl} ${optionsXML_}
'';
manual = pkgs.stdenv.mkDerivation {
@ -67,14 +68,10 @@ let
dst=$out/share/doc/nixos
ensureDir $dst
xsltproc $xsltFlags --nonet --xinclude \
--output ./manual.html \
--output $dst/manual.html \
${pkgs.docbook5_xsl}/xml/xsl/docbook/xhtml/docbook.xsl \
./manual.xml
sed '
s,!\([^!]*\)!!\([^!]*\)!,<a class="link" href="\1" target="_top"><code class="filename">\2</code></a>,g
' ./manual.html > $dst/manual.html
ln -s ${pkgs.docbook5_xsl}/xml/xsl/docbook/images $dst/
cp ${./style.css} $dst/style.css
@ -83,6 +80,7 @@ let
xsltproc --nonet --xinclude \
--param man.output.in.separate.dir 1 \
--param man.output.base.dir "'$out/share/man/'" \
--param man.endnotes.are.numbered 0 \
${pkgs.docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
./man-pages.xml

View file

@ -62,15 +62,15 @@
<xsl:if test="count(attr[@name = 'declarations']/list/*) != 0">
<para>
<emphasis>Declared by:</emphasis>
<xsl:apply-templates select="attr[@name = 'declarations']" />
</para>
<xsl:apply-templates select="attr[@name = 'declarations']" />
</xsl:if>
<xsl:if test="count(attr[@name = 'definitions']/list/*) != 0">
<para>
<emphasis>Defined by:</emphasis>
<xsl:apply-templates select="attr[@name = 'definitions']" />
</para>
<xsl:apply-templates select="attr[@name = 'definitions']" />
</xsl:if>
</listitem>
@ -129,20 +129,20 @@
<xsl:template match="derivation">
<xsl:choose>
<xsl:when test="attr[@name = 'url']/string/@value">
<emphasis>(download of <xsl:value-of select="attr[@name = 'url']/string/@value" />)</emphasis>
<replaceable>(download of <xsl:value-of select="attr[@name = 'url']/string/@value" />)</replaceable>
</xsl:when>
<xsl:otherwise>
<emphasis>(build of <xsl:value-of select="attr[@name = 'name']/string/@value" />)</emphasis>
<replaceable>(build of <xsl:value-of select="attr[@name = 'name']/string/@value" />)</replaceable>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="attr[@name = 'declarations' or @name = 'definitions']">
<itemizedlist>
<simplelist>
<xsl:for-each select="list/string">
<listitem><xsl:text> </xsl:text><xsl:value-of select="@value" /></listitem>
<member><filename xlink:href="http://example.org"><xsl:value-of select="@value" /></filename></member>
</xsl:for-each>
</itemizedlist>
</simplelist>
</xsl:template>
</xsl:stylesheet>

View file

@ -281,3 +281,8 @@ div.calloutlist td
{
padding-bottom: 1em;
}
table
{
margin-bottom: 1em;
}