mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
docs: Assign classes to documentation elements
In CSS the following class names are available: * keyword (keywords like "typedef", "struct") * type (types like "int", "void*") * comment (comments after members of enums or structs) * directive (preprocessor directives, #define) * undisclosed (text saying that the API is not public) Additionally, kill all of the left-over "programlisting" class assignments. There are no CSS rules for them. Signed-off-by: Claudio Bley <cbley@av-test.de>
This commit is contained in:
parent
de78bf604c
commit
458dd20da9
@ -116,16 +116,18 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="macro" mode="toc">
|
||||
<xsl:text>#define </xsl:text>
|
||||
<span class="directive">#define</span><xsl:text> </xsl:text>
|
||||
<a href="#{@name}"><xsl:value-of select="@name"/></a>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="variable" mode="toc">
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="string(@type)"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<a name="{@name}"></a>
|
||||
<xsl:value-of select="@name"/>
|
||||
@ -134,18 +136,21 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="typedef" mode="toc">
|
||||
<xsl:text>typedef </xsl:text><xsl:variable name="name" select="string(@name)"/>
|
||||
<span class="keyword">typedef</span>
|
||||
<xsl:text> </xsl:text><xsl:variable name="name" select="string(@name)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@type = 'enum'">
|
||||
<xsl:text>enum </xsl:text>
|
||||
<span class="keyword">enum</span><xsl:text> </xsl:text>
|
||||
<a href="#{$name}"><xsl:value-of select="$name"/></a>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<a name="{$name}"><xsl:value-of select="$name"/></a>
|
||||
<xsl:text>
|
||||
@ -159,7 +164,7 @@
|
||||
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
|
||||
<div class="api">
|
||||
<pre>
|
||||
<xsl:text>enum </xsl:text>
|
||||
<span class="keyword">enum</span><xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$name"/>
|
||||
<xsl:text> {
|
||||
</xsl:text>
|
||||
@ -173,10 +178,11 @@
|
||||
<td><xsl:value-of select="@value"/></td>
|
||||
<xsl:if test="@info != ''">
|
||||
<td>
|
||||
<xsl:text> : </xsl:text>
|
||||
<div class="comment">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@info"/>
|
||||
</xsl:call-template>
|
||||
</div>
|
||||
</td>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
@ -190,8 +196,8 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="struct" mode="toc">
|
||||
<xsl:text>typedef </xsl:text>
|
||||
<xsl:value-of select="@type"/>
|
||||
<span class="keyword">typedef</span><xsl:text> </xsl:text>
|
||||
<span class="type"><xsl:value-of select="@type"/></span>
|
||||
<xsl:text> </xsl:text>
|
||||
<a href="#{@name}"><xsl:value-of select="@name"/></a>
|
||||
<xsl:text>
|
||||
@ -202,32 +208,35 @@
|
||||
<h3><a name="{@name}"><code><xsl:value-of select="@name"/></code></a></h3>
|
||||
<div class="api">
|
||||
<pre>
|
||||
<xsl:text>struct </xsl:text>
|
||||
<span class="keyword">struct </span>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text>{
|
||||
<xsl:text> {
|
||||
</xsl:text>
|
||||
</pre>
|
||||
<table>
|
||||
<xsl:for-each select="field">
|
||||
<xsl:choose>
|
||||
<xsl:when test='@type = "union"'>
|
||||
<tr><td>union {</td></tr>
|
||||
<tr><td><span class="keyword">union</span> {</td></tr>
|
||||
<tr>
|
||||
<td><table>
|
||||
<xsl:for-each select="union/field">
|
||||
<tr>
|
||||
<td>
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
</td>
|
||||
<td><xsl:value-of select="@name"/></td>
|
||||
<xsl:if test="@info != ''">
|
||||
<td>
|
||||
<xsl:text> : </xsl:text>
|
||||
<div class="comment">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@info"/>
|
||||
</xsl:call-template>
|
||||
</div>
|
||||
</td>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
@ -238,10 +247,11 @@
|
||||
<td><xsl:value-of select="@name"/></td>
|
||||
<xsl:if test="@info != ''">
|
||||
<td>
|
||||
<xsl:text> : </xsl:text>
|
||||
<div class="comment">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@info"/>
|
||||
</xsl:call-template>
|
||||
</div>
|
||||
</td>
|
||||
</xsl:if>
|
||||
<td></td></tr>
|
||||
@ -249,17 +259,20 @@
|
||||
<xsl:otherwise>
|
||||
<tr>
|
||||
<td>
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
</td>
|
||||
<td><xsl:value-of select="@name"/></td>
|
||||
<xsl:if test="@info != ''">
|
||||
<td>
|
||||
<xsl:text> : </xsl:text>
|
||||
<div class="comment">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@info"/>
|
||||
</xsl:call-template>
|
||||
</div>
|
||||
</td>
|
||||
</xsl:if>
|
||||
</tr>
|
||||
@ -269,7 +282,7 @@
|
||||
<xsl:if test="not(field)">
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<xsl:text>The content of this structure is not made public by the API</xsl:text>
|
||||
<span class="undisclosed">The content of this structure is not made public by the API</span>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
@ -285,7 +298,7 @@
|
||||
<xsl:template match="macro">
|
||||
<xsl:variable name="name" select="string(@name)"/>
|
||||
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
|
||||
<pre><xsl:text>#define </xsl:text><xsl:value-of select="$name"/></pre>
|
||||
<pre class="api"><span class="directive">#define</span><xsl:text> </xsl:text><xsl:value-of select="$name"/></pre>
|
||||
<div>
|
||||
<xsl:call-template name="formattext">
|
||||
<xsl:with-param name="text" select="info"/>
|
||||
@ -299,9 +312,11 @@
|
||||
<xsl:variable name="nlen" select="string-length($name)"/>
|
||||
<xsl:variable name="tlen" select="string-length(return/@type)"/>
|
||||
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="return/@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text>	</xsl:text>
|
||||
<a href="#{@name}"><xsl:value-of select="@name"/></a>
|
||||
<xsl:if test="$blen - 40 < -8">
|
||||
@ -312,12 +327,14 @@
|
||||
</xsl:if>
|
||||
<xsl:text>	(</xsl:text>
|
||||
<xsl:if test="not(arg)">
|
||||
<xsl:text>void</xsl:text>
|
||||
<span class="type">void</span>
|
||||
</xsl:if>
|
||||
<xsl:for-each select="arg">
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:if test="position() != last()">
|
||||
@ -340,13 +357,15 @@
|
||||
<xsl:variable name="nlen" select="string-length($name)"/>
|
||||
<xsl:variable name="tlen" select="string-length(return/@type)"/>
|
||||
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
|
||||
<xsl:text>typedef </xsl:text>
|
||||
<span class="keyword">typedef</span><xsl:text> </xsl:text>
|
||||
<a href="#{$name}"><xsl:value-of select="$name"/></a>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="return/@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text>	</xsl:text>
|
||||
<a href="#{$name}"><xsl:value-of select="$name"/></a>
|
||||
<xsl:if test="$blen - 40 < -8">
|
||||
@ -357,12 +376,14 @@
|
||||
</xsl:if>
|
||||
<xsl:text>	(</xsl:text>
|
||||
<xsl:if test="not(arg)">
|
||||
<xsl:text>void</xsl:text>
|
||||
<span class="type">void</span>
|
||||
</xsl:if>
|
||||
<xsl:for-each select="arg">
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:if test="position() != last()">
|
||||
@ -388,11 +409,13 @@
|
||||
<xsl:variable name="tlen" select="string-length(return/@type)"/>
|
||||
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
|
||||
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
|
||||
<pre class="programlisting">
|
||||
<xsl:text>typedef </xsl:text>
|
||||
<pre class="api">
|
||||
<span class="keyword">typedef</span><xsl:text> </xsl:text>
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="return/@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text>	(*</xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:if test="$blen - 40 < -8">
|
||||
@ -403,16 +426,19 @@
|
||||
</xsl:if>
|
||||
<xsl:text>)	(</xsl:text>
|
||||
<xsl:if test="not(arg)">
|
||||
<xsl:text>void</xsl:text>
|
||||
<span class="type">void</span>
|
||||
</xsl:if>
|
||||
<xsl:for-each select="arg">
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text><br/>
|
||||
<xsl:text>,
|
||||
</xsl:text>
|
||||
<xsl:if test="$blen - 40 > 8">
|
||||
<xsl:text>	</xsl:text>
|
||||
</xsl:if>
|
||||
@ -465,10 +491,12 @@
|
||||
<xsl:variable name="tlen" select="string-length(return/@type)"/>
|
||||
<xsl:variable name="blen" select="(($nlen + 8) - (($nlen + 8) mod 8)) + (($tlen + 8) - (($tlen + 8) mod 8))"/>
|
||||
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
|
||||
<pre class="programlisting">
|
||||
<pre class="api">
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="return/@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text>	</xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:if test="$blen - 40 < -8">
|
||||
@ -479,16 +507,19 @@
|
||||
</xsl:if>
|
||||
<xsl:text>	(</xsl:text>
|
||||
<xsl:if test="not(arg)">
|
||||
<xsl:text>void</xsl:text>
|
||||
<span class="type">void</span>
|
||||
</xsl:if>
|
||||
<xsl:for-each select="arg">
|
||||
<span class="type">
|
||||
<xsl:call-template name="dumptext">
|
||||
<xsl:with-param name="text" select="@type"/>
|
||||
</xsl:call-template>
|
||||
</span>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:if test="position() != last()">
|
||||
<xsl:text>, </xsl:text><br/>
|
||||
<xsl:text>,
|
||||
</xsl:text>
|
||||
<xsl:if test="$blen - 40 > 8">
|
||||
<xsl:text>	</xsl:text>
|
||||
</xsl:if>
|
||||
@ -498,9 +529,7 @@
|
||||
<xsl:text>					 </xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:text>)</xsl:text><br/>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
<xsl:text>)</xsl:text>
|
||||
</pre>
|
||||
<div>
|
||||
<xsl:call-template name="formattext">
|
||||
@ -579,20 +608,20 @@
|
||||
<h2>Table of Contents</h2>
|
||||
<xsl:if test="count(exports[@type='macro']) > 0">
|
||||
<h3><a href="#macros">Macros</a></h3>
|
||||
<pre>
|
||||
<pre class="api">
|
||||
<xsl:apply-templates select="exports[@type='macro']" mode="toc">
|
||||
<xsl:sort select='@symbol'/>
|
||||
</xsl:apply-templates>
|
||||
</pre>
|
||||
</xsl:if>
|
||||
<h3><a href="#types">Types</a></h3>
|
||||
<pre>
|
||||
<pre class="api">
|
||||
<xsl:apply-templates select="exports[@type='typedef']" mode="toc">
|
||||
<xsl:sort select='@symbol'/>
|
||||
</xsl:apply-templates>
|
||||
</pre>
|
||||
<h3><a href="#functions">Functions</a></h3>
|
||||
<pre>
|
||||
<pre class="api">
|
||||
<xsl:apply-templates select="exports[@type='function']" mode="toc">
|
||||
<xsl:sort select='@symbol'/>
|
||||
</xsl:apply-templates>
|
||||
|
Loading…
Reference in New Issue
Block a user