[PATCH 12/12] docs: index: Convert to 'rst'

Peter Krempa posted 12 patches 1 year ago
[PATCH 12/12] docs: index: Convert to 'rst'
Posted by Peter Krempa 1 year ago
Final piece of conversion of our non-generated pages to 'rst'.

Special raw HTML is used for adding the appropriate code to fetch the
blog planet.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 docs/css/libvirt.css | 35 +++++++++++-------
 docs/css/mobile.css  |  8 ++--
 docs/index.html.in   | 87 --------------------------------------------
 docs/index.rst       | 70 +++++++++++++++++++++++++++++++++++
 docs/meson.build     | 12 +-----
 5 files changed, 98 insertions(+), 114 deletions(-)
 delete mode 100644 docs/index.html.in
 create mode 100644 docs/index.rst

diff --git a/docs/css/libvirt.css b/docs/css/libvirt.css
index 2f4daa4690..8dfec17047 100644
--- a/docs/css/libvirt.css
+++ b/docs/css/libvirt.css
@@ -105,8 +105,8 @@ main,
     width: 70em;
 }

-main#index,
-#index.document,
+main#the-virtualization-api,
+#the-virtualization-api.document,
 main#hvsupport,
 #hvsupport.document,
 main#documentation,
@@ -319,7 +319,8 @@ h6:hover > a.headerlink {
     visibility: visible;
 }

-div.panel,
+#the-virtualization-api section,
+#the-virtualization-api .section,
 #documentation section,
 #documentation .section,
 #knowledge-base section,
@@ -332,7 +333,8 @@ div.panel,
     background: rgb(230, 230, 230);
 }

-div.panel h2,
+#the-virtualization-api section h2,
+#the-virtualization-api .section h1,
 #documentation section h2,
 #documentation .section h1,
 #knowledge-base section h2,
@@ -347,7 +349,7 @@ div.panel h2,
     font-size: 1.6em;
 }

-#index.document h1 {
+#the-virtualization-api > h1 {
     border: 0px;
     text-indent: 100%; white-space: nowrap; overflow: hidden;
     background: url(../logos/logo-banner-dark-800.png) no-repeat center center;
@@ -412,21 +414,21 @@ br.clear {
     font-size: smaller;
 }

-div.panel dd,
+#the-virtualization-api dd,
 #documentation dd,
 #knowledge-base dd {
     font-size: smaller;
 }

-div.panel a,
+#the-virtualization-api a,
 #documentation a,
 #knowledge-base a {
     text-decoration: none;
 }

-div.panel ul,
-div.panel p,
-div.panel dl,
+#the-virtualization-api ul,
+#the-virtualization-api p,
+#the-virtualization-api dl,
 #documentation ul,
 #documentation p,
 #documentation dl,
@@ -437,19 +439,26 @@ div.panel dl,
     margin: 0px;
 }

-div.panel ul,
+#the-virtualization-api li p
+{
+    padding-left: 0.5em;
+    padding-top: 0px;
+    padding-bottom: 0px;
+}
+
+#the-virtualization-api ul,
 #documentation ul,
 #knowledge-base ul {
     margin-left: 1em;
 }

-div.panel dt,
+#the-virtualization-api dt,
 #documentation dt,
 #knowledge-base dt {
     margin: 0px;
 }

-div.panel dd,
+#the-virtualization-api dd,
 #documentation dd,
 #knowledge-base dd {
     margin: 0px;
diff --git a/docs/css/mobile.css b/docs/css/mobile.css
index 1b0bd8b350..2e223f468e 100644
--- a/docs/css/mobile.css
+++ b/docs/css/mobile.css
@@ -20,7 +20,8 @@
     #search form {
        padding: 5px;
     }
-    #index h1 {
+    #the-virtualization-api > h1,
+    #the-virtualization-api > h2 {
        display: none;
     }
     #jumplinks {
@@ -87,11 +88,12 @@
     #body {
        margin-top: 180px;
     }
+    #the-virtualization-api section,
+    #the-virtualization-api .section,
     #documentation section,
     #documentation .section,
     #knowledge-base section,
-    #knowledge-base .section,
-    div.panel {
+    #knowledge-base .section {
        width: 100%;
        margin-left: 0px;
        float: none;
diff --git a/docs/index.html.in b/docs/index.html.in
deleted file mode 100644
index 3c065badb7..0000000000
--- a/docs/index.html.in
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <script type="text/javascript">
-      <!--
-      window.addEventListener("load", function() { fetchRSS() });
-      // -->
-    </script>
-  </head>
-  <body id="index">
-    <h1>The virtualization API</h1>
-
-    <div class="panel">
-      <h2>Introduction</h2>
-      <p>
-        The libvirt project:
-      </p>
-      <ul>
-        <li>is a toolkit to manage <a href="platforms.html">virtualization platforms</a></li>
-        <li>is accessible from C, Python, Perl, Go and more</li>
-        <li>is licensed under open source licenses</li>
-        <li>supports <a href="drvqemu.html">KVM</a>,
-          <a href="drvqemu.html">Hypervisor.framework</a>,
-          <a href="drvqemu.html">QEMU</a>, <a href="drvxen.html">Xen</a>,
-          <a href="drvvirtuozzo.html">Virtuozzo</a>,
-          <a href="drvesx.html">VMWare ESX</a>,
-          <a href="drvlxc.html">LXC</a>,
-          <a href="drvbhyve.html">BHyve</a> and
-          <a href="drivers.html">more</a></li>
-        <li>targets Linux, FreeBSD, <a href="windows.html">Windows</a> and
-          <a href="macos.html">macOS</a></li>
-        <li>is used by many <a href="apps.html">applications</a></li>
-      </ul>
-      <p>Recent / forthcoming <a href="news.html">release changes</a></p>
-    </div>
-
-    <div class="panel">
-      <h2>Quick Links</h2>
-
-      <dl>
-        <dt><a href="contribute.html">New contributors</a></dt>
-        <dd>Get involved in the libvirt community &amp; student outreach programs</dd>
-
-        <dt><a href="securityprocess.html">Security vulnerabilities</a></dt>
-        <dd>View security notices and report vulnerabilities to the libvirt security response team</dd>
-
-        <dt><a href="bugs.html">Bug reporting</a></dt>
-        <dd>View and report bugs in libvirt packages</dd>
-
-        <dt><a href="format.html">XML configuration</a></dt>
-        <dd>Description of the XML schemas for
-          <a href="formatdomain.html">domains</a>,
-          <a href="formatnetwork.html">networks</a>,
-          <a href="formatnwfilter.html">network filtering</a>,
-          <a href="formatstorage.html">storage</a>,
-          <a href="formatstorageencryption.html">storage encryption</a>,
-          <a href="formatcaps.html">capabilities</a>,
-          <a href="formatdomaincaps.html">domain capabilities</a>,
-          <a href="formatstoragecaps.html">storage pool capabilities</a>,
-          <a href="formatnode.html">node devices</a>,
-          <a href="formatsecret.html">secrets</a>,
-          <a href="formatsnapshot.html">snapshots</a>,
-          <a href="formatcheckpoint.html">checkpoints</a>,
-          <a href="formatbackup.html">backup jobs</a></dd>
-        <dt><a href="https://wiki.libvirt.org">Wiki</a></dt>
-        <dd>Read further community contributed content</dd>
-
-        <dt><a href="kbase/index.html">Knowledge base</a></dt>
-        <dd>Learn more about libvirt through knowledge base</dd>
-      </dl>
-    </div>
-
-    <div class="panel">
-      <h2>Blog Planet</h2>
-      <div id="planet">
-      </div>
-
-      <p>
-        Read more on the <a href="https://planet.virt-tools.org/">Virt Tools blog planet</a>
-      </p>
-    </div>
-
-    <br class="clear"/>
-
-  </body>
-</html>
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000000..d55c4bb94d
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,70 @@
+======================
+The virtualization API
+======================
+
+Introduction
+------------
+
+The libvirt project:
+
+-  is a toolkit to manage `virtualization platforms <platforms.html>`__
+-  is accessible from C, Python, Perl, Go and more
+-  is licensed under open source licenses
+-  supports
+   `KVM <drvqemu.html>`__,
+   `Hypervisor.framework <drvqemu.html>`__,
+   `QEMU <drvqemu.html>`__,
+   `Xen <drvxen.html>`__,
+   `Virtuozzo <drvvirtuozzo.html>`__,
+   `VMWare ESX <drvesx.html>`__,
+   `LXC <drvlxc.html>`__,
+   `BHyve <drvbhyve.html>`__ and
+   `more <drivers.html>`__
+-  targets Linux, FreeBSD, `Windows <windows.html>`__ and `macOS <macos.html>`__
+-  is used by many `applications <apps.html>`__
+
+Recent / forthcoming `release changes <news.html>`__
+
+Quick Links
+-----------
+
+`New contributors <contribute.html>`__
+  Get involved in the libvirt community & student outreach programs
+`Security vulnerabilities <securityprocess.html>`__
+  View security notices and report vulnerabilities to the libvirt security
+  response team
+`Bug reporting <bugs.html>`__
+  View and report bugs in libvirt packages
+`XML configuration <format.html>`__
+  Description of the XML schemas for
+  `domains <formatdomain.html>`__,
+  `networks <formatnetwork.html>`__,
+  `network filtering <formatnwfilter.html>`__,
+  `storage <formatstorage.html>`__,
+  `storage encryption <formatstorageencryption.html>`__,
+  `capabilities <formatcaps.html>`__,
+  `domain capabilities <formatdomaincaps.html>`__,
+  `storage pool capabilities <formatstoragecaps.html>`__,
+  `node devices <formatnode.html>`__,
+  `secrets <formatsecret.html>`__,
+  `snapshots <formatsnapshot.html>`__,
+  `checkpoints <formatcheckpoint.html>`__,
+  `backup jobs <formatbackup.html>`__
+`Wiki <https://wiki.libvirt.org>`__
+  Read further community contributed content
+`Knowledge base <kbase/index.html>`__
+  Learn more about libvirt through knowledge base
+
+Blog Planet
+-----------
+
+.. raw:: html
+
+   <script type="text/javascript">
+     <!--
+     window.addEventListener("load", function() { fetchRSS() });
+     // -->
+   </script>
+   <div id="planet"> </div>
+
+Read more on the `Virt Tools blog planet <https://planet.virt-tools.org/>`__
diff --git a/docs/meson.build b/docs/meson.build
index 8edb93333a..2f0ecb2272 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -17,10 +17,6 @@ docs_assets = [
   'mstile-150x150.png',
 ]

-docs_html_in_files = [
-  'index',
-]
-
 docs_rst_files = [
   'aclpolkit',
   'advanced-tests',
@@ -84,6 +80,7 @@ docs_rst_files = [
   'governance',
   'hacking',
   'hooks',
+  'index',
   'issue-handling',
   'libvirt-go',
   'libvirt-go-xml',
@@ -230,13 +227,6 @@ html_xslt_gen = []
 # source - source filename relative to repository root (optional, if there is no source)
 # depends - explicit dependency on other input (optional)

-foreach name : docs_html_in_files
-  html_xslt_gen += {
-    'name': name,
-    'source': 'docs' / name + '.html.in',
-  }
-endforeach
-
 foreach name : docs_rst_files
   rst_file = '@0@.rst'.format(name)
   html_xslt_gen += {
-- 
2.40.1