[2/2] doc: Use enum argument type to make links in protocol documentation

Submitted by Bill Spitzak on April 23, 2015, 2:40 a.m.

Details

Message ID 1429756845-16856-3-git-send-email-spitzak@gmail.com
State Superseded
Delegated to: Bryce Harrington
Headers show

Not browsing as part of any series.

Commit Message

Bill Spitzak April 23, 2015, 2:40 a.m.
---
 doc/publican/protocol-to-docbook.xsl |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/doc/publican/protocol-to-docbook.xsl b/doc/publican/protocol-to-docbook.xsl
index 7b45969..3c4e140 100644
--- a/doc/publican/protocol-to-docbook.xsl
+++ b/doc/publican/protocol-to-docbook.xsl
@@ -146,6 +146,24 @@ 
   </varlistentry>
 </xsl:template>
 
+<!-- enum and bitfield arguemnts -->
+<xsl:template match="arg[@enum]">
+  <varlistentry>
+    <term><xsl:value-of select="@name"/></term>
+    <listitem>
+        <simpara>
+          <link linkend="protocol-spec-{../../@name}-enum-{@enum}">
+            <xsl:value-of select="../../@name"/>::<xsl:value-of select="@enum"/>
+          </link>
+          (<xsl:value-of select="@type"/>)
+          <xsl:if test="@summary" >
+            - <xsl:value-of select="@summary"/>
+          </xsl:if>
+        </simpara>
+    </listitem>
+  </varlistentry>
+</xsl:template>
+
 <!-- Request/event list -->
 <xsl:template match="request|event">
   <section id="protocol-spec-{../@name}-{name()}-{@name}">
@@ -168,7 +186,7 @@ 
 
 <!-- Enumeration -->
 <xsl:template match="enum">
-  <section id="protocol-spec-{../@name}-{name()}-{@name}">
+  <section id="protocol-spec-{../@name}-enum-{@name}">
     <title>
       <xsl:value-of select="../@name"/>::<xsl:value-of select="@name" />
       <xsl:if test="description/@summary">