summaryrefslogtreecommitdiff
path: root/man/custom-html.xsl
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-07 18:25:54 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-07 18:36:55 -0400
commit5aded369782f28255bc6b494ca905d7acaea7a56 (patch)
tree19967be26179b3084a1916e9ac6a7c69aee2e760 /man/custom-html.xsl
parent061df014fd60a6c1eefadcf9b84705015d0ce511 (diff)
downloadsystemd-5aded369782f28255bc6b494ca905d7acaea7a56.tar.gz
man: add a mapping for external manpages
It is annoying when we have dead links on fd.o. Add project='man-pages|die-net|archlinux' to <citerefentry>-ies. In generated html, add external links to http://man7.org/linux/man-pages/man, http://linux.die.net/man/, https://www.archlinux.org/. By default, pages in sections 2 and 4 go to man7, since Michael Kerrisk is the autorative source on kernel related stuff. The rest of links goes to linux.die.net, because they have the manpages. Except for the pacman stuff, since it seems to be only available from archlinux.org. Poor gummiboot gets no link, because gummitboot(8) ain't to be found on the net. According to common wisdom, that would mean that it does not exist. But I have seen Kay using it, so I know it does, and deserves to be found. Can somebody be nice and put it up somewhere?
Diffstat (limited to 'man/custom-html.xsl')
-rw-r--r--man/custom-html.xsl48
1 files changed, 47 insertions, 1 deletions
diff --git a/man/custom-html.xsl b/man/custom-html.xsl
index 060af2e56a..8bcc5f92d9 100644
--- a/man/custom-html.xsl
+++ b/man/custom-html.xsl
@@ -24,7 +24,7 @@
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
<!-- translate man page references to links to html pages -->
-<xsl:template match="citerefentry">
+<xsl:template match="citerefentry[not(@project)]">
<a>
<xsl:attribute name="href">
<xsl:value-of select="refentrytitle"/><xsl:text>.html</xsl:text>
@@ -33,6 +33,52 @@
</a>
</xsl:template>
+<xsl:template match="citerefentry[@project='man-pages'] | citerefentry[manvolnum='2'] | citerefentry[manvolnum='4']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>http://man7.org/linux/man-pages/man</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='die-net']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>http://linux.die.net/man/</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='archlinux']">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>https://www.archlinux.org/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="refentrytitle"/>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="manvolnum"/>
+ <xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:call-template name="inline.charseq"/>
+ </a>
+</xsl:template>
+
+<xsl:template match="citerefentry[@project='gummiboot']">
+ <xsl:call-template name="inline.charseq"/>
+</xsl:template>
+
<xsl:template match="refsect1/title|refsect1/info/title">
<!-- the ID is output in the block.object call for refsect1 -->
<h2>