docs: Make anchors in API html files clickable/linkable

Use 'id' instead of 'name' for anchors which adds the hidden clickable
headerlink helper so it's way simpler to link to a specific part of the
docs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-08-15 10:14:08 +02:00
parent e9c6158838
commit 5726e47234

View File

@ -308,7 +308,7 @@
<xsl:template match="typedef[@type = 'enum']"> <xsl:template match="typedef[@type = 'enum']">
<xsl:variable name="name" select="string(@name)"/> <xsl:variable name="name" select="string(@name)"/>
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3> <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<div class="api"> <div class="api">
<pre> <pre>
<span class="keyword">enum</span><xsl:text> </xsl:text> <span class="keyword">enum</span><xsl:text> </xsl:text>
@ -357,7 +357,7 @@
</xsl:template> </xsl:template>
<xsl:template match="struct"> <xsl:template match="struct">
<h3><a name="{@name}"><code><xsl:value-of select="@name"/></code></a></h3> <h3><a id="{@name}"><code><xsl:value-of select="@name"/></code></a></h3>
<div class="api"> <div class="api">
<pre> <pre>
<span class="keyword">struct </span> <span class="keyword">struct </span>
@ -447,7 +447,7 @@
<xsl:template match="macro"> <xsl:template match="macro">
<xsl:variable name="name" select="string(@name)"/> <xsl:variable name="name" select="string(@name)"/>
<h3><a name="{$name}"><code><xsl:value-of select="$name"/></code></a></h3> <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api"><span class="directive">#define</span><xsl:text> </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 class="description"> <div class="description">
<xsl:call-template name="formattext"> <xsl:call-template name="formattext">
@ -558,7 +558,7 @@
<xsl:variable name="nlen" select="string-length($name)"/> <xsl:variable name="nlen" select="string-length($name)"/>
<xsl:variable name="tlen" select="string-length(return/@type)"/> <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: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> <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api"> <pre class="api">
<span class="keyword">typedef</span><xsl:text> </xsl:text> <span class="keyword">typedef</span><xsl:text> </xsl:text>
<span class="type"> <span class="type">
@ -636,7 +636,7 @@
<xsl:variable name="nlen" select="string-length($name)"/> <xsl:variable name="nlen" select="string-length($name)"/>
<xsl:variable name="tlen" select="string-length(return/@type)"/> <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: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> <h3><a id="{$name}"><code><xsl:value-of select="$name"/></code></a></h3>
<pre class="api"> <pre class="api">
<span class="type"> <span class="type">
<xsl:call-template name="dumptext"> <xsl:call-template name="dumptext">
@ -783,16 +783,16 @@
<h2>Description</h2> <h2>Description</h2>
<xsl:if test="count(exports[@type='macro']) > 0"> <xsl:if test="count(exports[@type='macro']) > 0">
<h3><a name="macros">Macros</a></h3> <h3><a id="macros">Macros</a></h3>
<xsl:apply-templates select="exports[@type='macro']"> <xsl:apply-templates select="exports[@type='macro']">
<xsl:sort select='@symbol'/> <xsl:sort select='@symbol'/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:if> </xsl:if>
<h3><a name="types">Types</a></h3> <h3><a id="types">Types</a></h3>
<xsl:apply-templates select="exports[@type='typedef']"> <xsl:apply-templates select="exports[@type='typedef']">
<xsl:sort select='@symbol'/> <xsl:sort select='@symbol'/>
</xsl:apply-templates> </xsl:apply-templates>
<h3><a name="functions">Functions</a></h3> <h3><a id="functions">Functions</a></h3>
<xsl:apply-templates select="exports[@type='function']"> <xsl:apply-templates select="exports[@type='function']">
<xsl:sort select='@symbol'/> <xsl:sort select='@symbol'/>
</xsl:apply-templates> </xsl:apply-templates>