summaryrefslogtreecommitdiff
path: root/docs/page.xsl
diff options
context:
space:
mode:
authorPeter Krempa <pkrempa@redhat.com>2022-04-12 13:00:45 +0200
committerPeter Krempa <pkrempa@redhat.com>2022-04-13 13:02:06 +0200
commit8b60342f76a744e61c16ea683b44996dd462bfda (patch)
tree6d803d48003972f1cf6bf6d0504ab9f519418a1f /docs/page.xsl
parentb27937972f7c36172daee980a24e798170e39d31 (diff)
downloadlibvirt-8b60342f76a744e61c16ea683b44996dd462bfda.tar.gz
docs: Adapt to semantic tag usage of docutils-0.17 and later
Docutils-0.17 switched to using <main> instead of a <div class='document'> and <section> instead of <div class='section'>. To ensure that our pages still work we need to slightly adapt our XSL stylesheet to select the <main> tag properly and adapt the CSS to also select the 'section' element instead of a class and to apply to a <main> tag with the appropriate names. Docutils-0.17 also changed to use 'h2' for section heading instead of 'h1'. Note the styles applied to the 'main' element with certain id can't be made more universal by just applying to the id itself, as in certain cases (e.g. 'documentation') we also have sections with that name. This was previously ensured by also matching the 'document' class which would make it equal to the 'main' element. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Diffstat (limited to 'docs/page.xsl')
-rw-r--r--docs/page.xsl6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/page.xsl b/docs/page.xsl
index a6a270896c..7d0203cf62 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -120,9 +120,15 @@
<body onload="pageload()">
<div id="body">
<xsl:choose>
+ <!-- docutils-0.16 and older use a div as container for contents -->
<xsl:when test="html:html/html:body/html:div/@class='document'">
<xsl:apply-templates select="/html:html/html:body/*" mode="content"/>
</xsl:when>
+ <!-- docutils-0.17 adopted use of the 'main' semantic container -->
+ <xsl:when test="html:html/html:body/html:main">
+ <xsl:apply-templates select="/html:html/html:body/*" mode="content"/>
+ </xsl:when>
+ <!-- for our older html-only files -->
<xsl:otherwise>
<div class="document">
<xsl:if test="html:html/html:body/@id">