* 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 let
# To prevent infinite recursion, remove system.path from the # To prevent infinite recursion, remove system.path from the
# options. Not sure why this happens. # options. Not sure why this happens.
options_ = options_ =
@ -33,7 +34,7 @@ let
''; '';
optionsDocBook = pkgs.runCommand "options-db.xml" {} '' 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 { manual = pkgs.stdenv.mkDerivation {
@ -67,14 +68,10 @@ let
dst=$out/share/doc/nixos dst=$out/share/doc/nixos
ensureDir $dst ensureDir $dst
xsltproc $xsltFlags --nonet --xinclude \ xsltproc $xsltFlags --nonet --xinclude \
--output ./manual.html \ --output $dst/manual.html \
${pkgs.docbook5_xsl}/xml/xsl/docbook/xhtml/docbook.xsl \ ${pkgs.docbook5_xsl}/xml/xsl/docbook/xhtml/docbook.xsl \
./manual.xml ./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/ ln -s ${pkgs.docbook5_xsl}/xml/xsl/docbook/images $dst/
cp ${./style.css} $dst/style.css cp ${./style.css} $dst/style.css
@ -83,6 +80,7 @@ let
xsltproc --nonet --xinclude \ xsltproc --nonet --xinclude \
--param man.output.in.separate.dir 1 \ --param man.output.in.separate.dir 1 \
--param man.output.base.dir "'$out/share/man/'" \ --param man.output.base.dir "'$out/share/man/'" \
--param man.endnotes.are.numbered 0 \
${pkgs.docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \ ${pkgs.docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
./man-pages.xml ./man-pages.xml

View file

@ -62,15 +62,15 @@
<xsl:if test="count(attr[@name = 'declarations']/list/*) != 0"> <xsl:if test="count(attr[@name = 'declarations']/list/*) != 0">
<para> <para>
<emphasis>Declared by:</emphasis> <emphasis>Declared by:</emphasis>
<xsl:apply-templates select="attr[@name = 'declarations']" />
</para> </para>
<xsl:apply-templates select="attr[@name = 'declarations']" />
</xsl:if> </xsl:if>
<xsl:if test="count(attr[@name = 'definitions']/list/*) != 0"> <xsl:if test="count(attr[@name = 'definitions']/list/*) != 0">
<para> <para>
<emphasis>Defined by:</emphasis> <emphasis>Defined by:</emphasis>
<xsl:apply-templates select="attr[@name = 'definitions']" />
</para> </para>
<xsl:apply-templates select="attr[@name = 'definitions']" />
</xsl:if> </xsl:if>
</listitem> </listitem>
@ -129,20 +129,20 @@
<xsl:template match="derivation"> <xsl:template match="derivation">
<xsl:choose> <xsl:choose>
<xsl:when test="attr[@name = 'url']/string/@value"> <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:when>
<xsl:otherwise> <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:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="attr[@name = 'declarations' or @name = 'definitions']"> <xsl:template match="attr[@name = 'declarations' or @name = 'definitions']">
<itemizedlist> <simplelist>
<xsl:for-each select="list/string"> <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> </xsl:for-each>
</itemizedlist> </simplelist>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View file

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