[libvirt] [PATCH v2 04/15] docs: adapt filling of <head> section for rst2html output

Daniel P. Berrangé berrange at redhat.com
Fri Nov 22 14:46:51 UTC 2019


The HTML from rst2html doesn't have <h1> immediately under the <body>
tag, instead there is at least one <div> in between.

There are also many things added in the <head> section that we don't
want to have copied over, since our templating system already adds
suitable <head> elements.

We only need to copy the <script> to make index.html work.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 docs/page.xsl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/page.xsl b/docs/page.xsl
index 6f429ae087..70dfec6df6 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -97,9 +97,9 @@
         <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
         <link rel="manifest" href="/manifest.json"/>
         <meta name="theme-color" content="#ffffff"/>
-        <title>libvirt: <xsl:value-of select="html:html/html:body/html:h1"/></title>
+        <title>libvirt: <xsl:value-of select="html:html/html:body//html:h1"/></title>
         <meta name="description" content="libvirt, virtualization, virtualization API"/>
-        <xsl:apply-templates select="/html:html/html:head/*" mode="content"/>
+        <xsl:apply-templates select="/html:html/html:head/html:script" mode="content"/>
 
         <script type="text/javascript" src="{$href_base}js/main.js">
           <xsl:comment>// forces non-empty element</xsl:comment>
-- 
2.23.0




More information about the libvir-list mailing list