summaryrefslogtreecommitdiff
path: root/docs/page.xsl
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2019-11-11 15:53:02 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2019-12-04 15:48:28 +0000
commita329bd0376c0125b9cdb1fba949be0a24a98464c (patch)
treeb0971a1acb8bd8476457310803e46d2e679272ec /docs/page.xsl
parent8215da927a8fe69c4f98e962adc7592978c5f72c (diff)
downloadlibvirt-a329bd0376c0125b9cdb1fba949be0a24a98464c.tar.gz
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>
Diffstat (limited to 'docs/page.xsl')
-rw-r--r--docs/page.xsl5
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/page.xsl b/docs/page.xsl
index 70dfec6df6..f8f7ff8cf9 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -176,12 +176,15 @@
<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:template match="html:h1 | html:h2 | html:h3 | html:h4 | html:h5 | html:h6" mode="content">
<xsl:element name="{name()}">
<xsl:apply-templates mode="copy" />
<xsl:if test="./html:a/@id">
<a class="headerlink" href="#{html:a/@id}" title="Permalink to this headline">&#xb6;</a>
</xsl:if>
+ <xsl:if test="./html:a[@class='toc-backref']">
+ <a class="headerlink" href="#{../@id}" title="Permalink to this headline">&#xb6;</a>
+ </xsl:if>
</xsl:element>
</xsl:template>