page.xsl was adding '<div id="content">' wrapper for the content
picked
up from the <body> element from the original input file. Optionally
class="$DOCNAME" was added for some documents taken from <body>.
Since docs generated from RST by docutils have a '<div class='document'
id='$DOCNAME>' we actually don't need an extra wrapper for them.
Additionally if we standardize on one of them we can use the same styles
for both. I've picked the latter because it makes more sense to use the
document name as 'id'.
This patch:
1) Modifies the XSL trasformation to add the wrapper only if it's not
present.
2) Modifies the XSL transformation to use 'id' for document name and
class='document' for the wrapper element.
3) Changes docs.html/index.html/hvsupport.html to use 'id' instead of
'class' for document name.
4) Modifies the main stylesheet to keep styling the elements properly
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
docs/docs.html.in | 2 +-
docs/index.html.in | 2 +-
docs/libvirt.css | 12 ++++++------
docs/page.xsl | 23 +++++++++++++++--------
scripts/hvsupport.py | 2 +-
5 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/docs/docs.html.in b/docs/docs.html.in
index 77d5c78b30..22a43517ed 100644
--- a/docs/docs.html.in
+++ b/docs/docs.html.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml">
- <body class="docs">
+ <body id="docs">
<h1>Documentation</h1>
<div class="panel">
<h2>Deployment / operation</h2>
diff --git a/docs/index.html.in b/docs/index.html.in
index 3057a052dd..df182c27b6 100644
--- a/docs/index.html.in
+++ b/docs/index.html.in
@@ -8,7 +8,7 @@
// -->
</script>
</head>
- <body class="index">
+ <body id="index">
<h1>The virtualization API</h1>
<div class="panel">
diff --git a/docs/libvirt.css b/docs/libvirt.css
index 1511ccf9e9..bb71244a7e 100644
--- a/docs/libvirt.css
+++ b/docs/libvirt.css
@@ -95,7 +95,7 @@
margin-right: 1em;
}
-#content {
+.document {
margin-left: auto;
margin-right: auto;
padding: 0px;
@@ -104,9 +104,9 @@
width: 70em;
}
-body.index #content,
-body.docs #content,
-body.hvsupport #content
+#index.document,
+#docs.document,
+#hvsupport.document
{
width: inherit;
}
@@ -412,14 +412,14 @@ div.panel h2 {
text-align: center;
}
-body.index h1 {
+#index.document h1 {
border: 0px;
text-indent: 100%; white-space: nowrap; overflow: hidden;
background: url(logos/logo-banner-dark-800.png) no-repeat center center;
height: 300px;
}
-body.docs h1 {
+#docs.document h1 {
visibility: hidden;
}
diff --git a/docs/page.xsl b/docs/page.xsl
index 9e0d4e0954..5cb4322fdc 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -112,15 +112,22 @@
</script>
</head>
<body onload="pageload()">
- <xsl:if test="html:html/html:body/@class">
- <xsl:attribute name="class">
- <xsl:value-of select="html:html/html:body/@class"/>
- </xsl:attribute>
- </xsl:if>
<div id="body">
- <div id="content">
- <xsl:apply-templates select="/html:html/html:body/*"
mode="content"/>
- </div>
+ <xsl:choose>
+ <xsl:when
test="html:html/html:body/html:div/@class='document'">
+ <xsl:apply-templates select="/html:html/html:body/*"
mode="content"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <div class="document">
+ <xsl:if test="html:html/html:body/@id">
+ <xsl:attribute name="id">
+ <xsl:value-of select="html:html/html:body/@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="/html:html/html:body/*"
mode="content"/>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
</div>
<div id="nav">
<div id="home">
diff --git a/scripts/hvsupport.py b/scripts/hvsupport.py
index e2aab8feff..50ba25c78f 100755
--- a/scripts/hvsupport.py
+++ b/scripts/hvsupport.py
@@ -420,7 +420,7 @@ for drv in drivers.keys():
print('''<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml">
-<body class="hvsupport">
+<body id="hvsupport">
<h1>libvirt API support matrix</h1>
<ul id="toc"></ul>
--
2.26.2