mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 02:04:16 +03:00
docs: add a permalink to html headers
Quite often, I need to cite URLs like http://libvirt.org/formatnetwork.html#elementQoS but it is annoying to copy them from the table of contents or the html source. This patch borrows from the Python documentation in order to make it easier to cite headers on libvirt's oneline documentation.
This commit is contained in:
parent
29ea437e40
commit
237a088ba4
@ -498,3 +498,16 @@ div.description pre.code {
|
||||
padding: 5px 10px 5px 10px;
|
||||
margin-left: 2.5em;
|
||||
}
|
||||
|
||||
a.headerlink {
|
||||
text-decoration: none!important;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
h2:hover > a.headerlink,
|
||||
h3:hover > a.headerlink,
|
||||
h4:hover > a.headerlink,
|
||||
h5:hover > a.headerlink,
|
||||
h6:hover > a.headerlink {
|
||||
visibility: visible;
|
||||
}
|
||||
|
@ -185,4 +185,24 @@
|
||||
|
||||
<xsl:apply-templates select="exsl:node-set($inchtml)/html:html/html:body/*" mode="content"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="html:h2 | html:h3 | html:h4 | html:h5 | html:h6" mode="content">
|
||||
<xsl:element name="{name()}" namespace="{namespace-uri()}">
|
||||
<xsl:apply-templates mode="copy" />
|
||||
<xsl:if test="./html:a/@name">
|
||||
<a class="headerlink" href="#{html:a/@name}" title="Permalink to this headline">¶</a>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="text()" mode="copy">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="node()" mode="copy">
|
||||
<xsl:element name="{name()}" namespace="{namespace-uri()}">
|
||||
<xsl:copy-of select="./@*"/>
|
||||
<xsl:apply-templates mode="copy" />
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
Loading…
x
Reference in New Issue
Block a user