mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
docs: generate permalinks correctly for rst2html output
The rst2html output generates the links for headings in a slightly different way than we do for docs written in HTML, so we must match another scenario when generating back links. rst2html will also use <h1> tags for both the document title and the first level of section titles, so we must expand the matching to allow for this too. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
8215da927a
commit
a329bd0376
@ -419,6 +419,7 @@ a.headerlink {
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1:hover > a.headerlink,
|
||||||
h2:hover > a.headerlink,
|
h2:hover > a.headerlink,
|
||||||
h3:hover > a.headerlink,
|
h3:hover > a.headerlink,
|
||||||
h4:hover > a.headerlink,
|
h4:hover > a.headerlink,
|
||||||
|
@ -176,12 +176,15 @@
|
|||||||
<xsl:apply-templates select="exsl:node-set($inchtml)/html:html/html:body/*" mode="content"/>
|
<xsl:apply-templates select="exsl:node-set($inchtml)/html:html/html:body/*" mode="content"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="html:h2 | html:h3 | html:h4 | html:h5 | html:h6" mode="content">
|
<xsl:template match="html:h1 | html:h2 | html:h3 | html:h4 | html:h5 | html:h6" mode="content">
|
||||||
<xsl:element name="{name()}">
|
<xsl:element name="{name()}">
|
||||||
<xsl:apply-templates mode="copy" />
|
<xsl:apply-templates mode="copy" />
|
||||||
<xsl:if test="./html:a/@id">
|
<xsl:if test="./html:a/@id">
|
||||||
<a class="headerlink" href="#{html:a/@id}" title="Permalink to this headline">¶</a>
|
<a class="headerlink" href="#{html:a/@id}" title="Permalink to this headline">¶</a>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
<xsl:if test="./html:a[@class='toc-backref']">
|
||||||
|
<a class="headerlink" href="#{../@id}" title="Permalink to this headline">¶</a>
|
||||||
|
</xsl:if>
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user