[PATCH 6/6] docs: generate links from plain text documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are two forms used throughout libvirt code comments, which
are both supported by this patch.

* plain links like e.g. http://www.libvirt.org/
* links enclosed in <> characters, e.g. <http://www.libvirt.org/>

Signed-off-by: Claudio Bley <cbley@xxxxxxxxxx>
---
 docs/newapi.xsl |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index a08b304..815c1b9 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -129,6 +129,19 @@
         <a href="libvirt-{$ref/@file}.html#{$ref/@name}"><xsl:value-of select="$stem"/></a>
         <xsl:value-of select="substring-after($token, $stem)"/>
       </xsl:when>
+      <xsl:when test="starts-with($token, 'http://')">
+        <a href="{$token}">
+          <xsl:value-of select="$token"/>
+        </a>
+      </xsl:when>
+      <xsl:when test="starts-with($token, '&lt;http://') and contains($token, '&gt;')">
+        <xsl:variable name="link"
+                      select="substring(substring-before($token, '&gt;'), 2)"/>
+        <a href="{$link}">
+          <xsl:value-of select="$link"/>
+        </a>
+        <xsl:value-of select="substring-after($token, '&gt;')"/>
+      </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="$token"/>
       </xsl:otherwise>
@@ -690,7 +703,11 @@
       <h2 style="font-weight:bold;color:red;text-align:center">This module is deprecated</h2>
     </xsl:if>
     <xsl:if test="description">
-      <p><xsl:value-of select="description"/></p>
+      <p>
+        <xsl:call-template name="dumptext">
+          <xsl:with-param name="text" select="description"/>
+        </xsl:call-template>
+      </p>
     </xsl:if>
   </xsl:template>
 
-- 
1.7.9.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]