]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs: generate links from plain text documentation
authorClaudio Bley <cbley@av-test.de>
Mon, 14 Jan 2013 12:37:02 +0000 (13:37 +0100)
committerClaudio Bley <cbley@av-test.de>
Wed, 30 Oct 2013 16:30:12 +0000 (17:30 +0100)
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@av-test.de>
docs/newapi.xsl

index a08b3049ed3583b78e336c9de958d3392ab8ae00..815c1b9d770c2e960289065b580a0fbd959c385f 100644 (file)
         <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>
       <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>