diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-05-03 20:25:57 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-05-03 20:25:57 -0400 |
commit | 20089f95e83dd6a3e9238b3448ce2e55536184ff (patch) | |
tree | c174ff9fe28e0b4c96514bd279d99ef225714819 /man/custom-html.xsl | |
parent | e9dd0369e4b3fa05569521eb83ff8142e6dd9a7c (diff) | |
download | systemd-20089f95e83dd6a3e9238b3448ce2e55536184ff.tar.gz |
man: provide "permalinks" to sections and terms
So no one needs to say "go to fd.o/software/systemd/man, open page X,
then scroll down to section 3, and look for ..." anymore.
Diffstat (limited to 'man/custom-html.xsl')
-rw-r--r-- | man/custom-html.xsl | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/man/custom-html.xsl b/man/custom-html.xsl index c4099b26ba..2e40ab1660 100644 --- a/man/custom-html.xsl +++ b/man/custom-html.xsl @@ -33,8 +33,86 @@ </a> </xsl:template> +<xsl:template match="refsect1/title|refsect1/info/title"> + <!-- the ID is output in the block.object call for refsect1 --> + <h2> + <xsl:attribute name="id"> + <xsl:call-template name="inline.charseq"/> + </xsl:attribute> + <xsl:apply-templates/> + <a> + <xsl:attribute name="class"> + <xsl:text>headerlink</xsl:text> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:text>Permalink to this headline</xsl:text> + </xsl:attribute> + <xsl:attribute name="href"> + <!-- <xsl:call-template name="href.target.uri" /> --> + <xsl:text>#</xsl:text> + <xsl:call-template name="inline.charseq"/> + </xsl:attribute> + <xsl:text>¶</xsl:text> + </a> + </h2> +</xsl:template> + +<xsl:template match="varlistentry"> + <dt> + <xsl:attribute name="id"> + <xsl:call-template name="inline.charseq"> + <xsl:with-param name="content"> + <xsl:copy-of select="term[position()=1]" /> + </xsl:with-param> + </xsl:call-template> + </xsl:attribute> + <xsl:apply-templates select="term"/> + <a> + <xsl:attribute name="class"> + <xsl:text>headerlink</xsl:text> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:text>Permalink to this term</xsl:text> + </xsl:attribute> + <xsl:attribute name="href"> + <!-- <xsl:call-template name="href.target.uri" /> --> + <xsl:text>#</xsl:text> + <xsl:call-template name="inline.charseq"> + <xsl:with-param name="content"> + <xsl:copy-of select="term[position()=1]" /> + </xsl:with-param> + </xsl:call-template> + </xsl:attribute> + <xsl:text>¶</xsl:text> + </a> + </dt> + <dd> + <xsl:apply-templates select="listitem"/> + </dd> +</xsl:template> + + <!-- add Index link at top of page --> <xsl:template name="user.header.content"> + <style> + a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; + visibility: hidden; + } + + a.headerlink:hover { + background-color: #c60f0f; + color: white; + } + + h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink { + visibility: visible; + } + </style> + <a> <xsl:attribute name="href"> <xsl:text>index.html</xsl:text> |