[PATCH 3/4] docs: go: Add 'go-import' metadata via rST

Martin Kletzander mkletzan at redhat.com
Thu Jun 1 08:23:47 UTC 2023


On Wed, May 31, 2023 at 05:08:36PM +0200, Peter Krempa wrote:
>The '.. meta::' rST directive allows adding header metadata. Move the
>specific metadata from page.xsl into the individual files and pass them
>trhough into the header from page.xsl.

through

>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> docs/go/libvirt.rst     |  3 +++
> docs/go/libvirtxml.rst  |  3 +++
> docs/libvirt-go-xml.rst |  3 +++
> docs/libvirt-go.rst     |  3 +++
> docs/page.xsl           | 13 ++-----------
> 5 files changed, 14 insertions(+), 11 deletions(-)
>
>diff --git a/docs/go/libvirt.rst b/docs/go/libvirt.rst
>index 6a1344ad3e..09eaa66714 100644
>--- a/docs/go/libvirt.rst
>+++ b/docs/go/libvirt.rst
>@@ -1,3 +1,6 @@
>+.. meta::
>+   :go-import: libvirt.org/go/libvirt git https://gitlab.com/libvirt/libvirt-go-module.git
>+
> =========================================
> Libvirt Go Language API (with Go modules)
> =========================================
>diff --git a/docs/go/libvirtxml.rst b/docs/go/libvirtxml.rst
>index 5407d609f2..315499da1a 100644
>--- a/docs/go/libvirtxml.rst
>+++ b/docs/go/libvirtxml.rst
>@@ -1,3 +1,6 @@
>+.. meta::
>+   :go-import: libvirt.org/go/libvirtxml git https://gitlab.com/libvirt/libvirt-go-xml-module.git
>+
> ============================================
> Libvirt Go XML parsing API (with Go modules)
> ============================================
>diff --git a/docs/libvirt-go-xml.rst b/docs/libvirt-go-xml.rst
>index d2a488d99d..822dc73638 100644
>--- a/docs/libvirt-go-xml.rst
>+++ b/docs/libvirt-go-xml.rst
>@@ -1,3 +1,6 @@
>+.. meta::
>+   :go-import: libvirt.org/libvirt-go-xml git https://gitlab.com/libvirt/libvirt-go-xml.git
>+
> ===================================================
> Obsolete libvirt Go XML parsing API (no Go modules)
> ===================================================
>diff --git a/docs/libvirt-go.rst b/docs/libvirt-go.rst
>index 85ee3191b5..60ec9fbbb2 100644
>--- a/docs/libvirt-go.rst
>+++ b/docs/libvirt-go.rst
>@@ -1,3 +1,6 @@
>+.. meta::
>+   :go-import: libvirt.org/libvirt-go git https://gitlab.com/libvirt/libvirt-go.git
>+
> ================================================
> Obsolete libvirt Go Language API (no Go modules)
> ================================================
>diff --git a/docs/page.xsl b/docs/page.xsl
>index e3112fc9f8..27607e4d92 100644
>--- a/docs/page.xsl
>+++ b/docs/page.xsl
>@@ -44,17 +44,8 @@
>         <meta name="theme-color" content="#ffffff"/>
>         <title>libvirt: <xsl:value-of select="html:html/html:body//html:h1"/></title>
>         <meta name="description" content="libvirt, virtualization, virtualization API"/>
>-        <xsl:if test="$pagesrc = 'docs/libvirt-go.rst'">
>-          <meta name="go-import" content="libvirt.org/libvirt-go git https://gitlab.com/libvirt/libvirt-go.git"/>
>-        </xsl:if>
>-        <xsl:if test="$pagesrc = 'docs/libvirt-go-xml.rst'">
>-          <meta name="go-import" content="libvirt.org/libvirt-go-xml git https://gitlab.com/libvirt/libvirt-go-xml.git"/>
>-        </xsl:if>
>-        <xsl:if test="$pagesrc = 'docs/go/libvirt.rst'">
>-          <meta name="go-import" content="libvirt.org/go/libvirt git https://gitlab.com/libvirt/libvirt-go-module.git"/>
>-        </xsl:if>
>-        <xsl:if test="$pagesrc = 'docs/go/libvirtxml.rst'">
>-          <meta name="go-import" content="libvirt.org/go/libvirtxml git https://gitlab.com/libvirt/libvirt-go-xml-module.git"/>
>+        <xsl:if test="/html:html/html:head/html:meta[@name='go-import']">
>+            <meta name="go-import" content="{/html:html/html:head/html:meta[@name='go-import']/@content}"/>
>         </xsl:if>
>
>         <script type="text/javascript" src="{$href_base}js/main.js">
>-- 
>2.40.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230601/01d71748/attachment-0001.sig>


More information about the libvir-list mailing list