mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
docs: page.xsl: Improve generation of paragraph anchor links
Use the 'parent' axis to check whether the parent is a div with class='section' rather than looking for 'toc-backref' anchor to see whether to generate one of the headerlink alternatives. Both hare docutils-specific thus apply to docs generated from RST documents. This adds the links for pages generated from RST documents which don't have a table of contents (and thus lack the 'toc-backref' anchors) and thus fixes pages such as hacking.html and news.html to have reasonable links which can be shared. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
e9b434efde
commit
b9759291c5
@ -196,7 +196,7 @@
|
||||
<xsl:if test="./html:a/@id">
|
||||
<a class="headerlink" href="#{html:a/@id}" title="Permalink to this headline">¶</a>
|
||||
</xsl:if>
|
||||
<xsl:if test="./html:a[@class='toc-backref']">
|
||||
<xsl:if test="parent::html:div[@class='section']">
|
||||
<a class="headerlink" href="#{../@id}" title="Permalink to this headline">¶</a>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
|
Loading…
Reference in New Issue
Block a user