chiark / gitweb /
man: html - cross-ref man page references and add Index link
authorKay Sievers <kay@vrfy.org>
Tue, 17 Jul 2012 21:04:48 +0000 (23:04 +0200)
committerKay Sievers <kay@vrfy.org>
Tue, 17 Jul 2012 21:04:48 +0000 (23:04 +0200)
Makefile.am
man/custom-html.xsl

index b8ec740e055d12b2460f0a57f672ca3101fb8b26..ab143da8bec7bd09cf3c0cd54faee6c8ff2f8f1f 100644 (file)
@@ -3420,7 +3420,7 @@ man/%.7: man/%.xml
 man/%.8: man/%.xml
        $(XSLTPROC_PROCESS_MAN)
 
-man/%.html: man/%.xml
+man/%.html: man/%.xml man/custom-html.xsl
        $(XSLTPROC_PROCESS_HTML)
 
 CLEANFILES += \
index df16d0871876747c9287ed9eb4b96eae7069d270..906ddc5572e8b0d0e36cdf8a8fd8699a9a05c5e1 100644 (file)
 
 <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">
+  <a>
+    <xsl:attribute name="href">
+      <xsl:value-of select="refentrytitle"/><xsl:text>.html</xsl:text>
+    </xsl:attribute>
+    <xsl:call-template name="inline.charseq"/>
+  </a>
+</xsl:template>
+
+<!-- add Index link at top of page -->
+<xsl:template name="user.header.content">
+  <a>
+    <xsl:attribute name="href">
+      <xsl:text>index.html</xsl:text>
+    </xsl:attribute>
+    <xsl:text>Index </xsl:text>
+  </a>
+  <hr/>
+</xsl:template>
+
 <!-- Switch things to UTF-8, ISO-8859-1 is soo yesteryear -->
 <xsl:output method="html" encoding="UTF-8" indent="no"/>