summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2012-03-16 10:52:47 -0400
committerShaun McCance <shaunm@gnome.org>2012-03-16 10:52:47 -0400
commitbfa6c74b7ecf7fdc17ba876619bfefbb185fc422 (patch)
treebdd47c09a3a82ba77ec1c34462a6ab2f279a5262
parent8f46d17a2636b2a650c70e02f5c8a55b096cc010 (diff)
downloadyelp-xsl-bfa6c74b7ecf7fdc17ba876619bfefbb185fc422.tar.gz
mal2html-api: Make C padding values xsl:variables
-rw-r--r--test/api/func2.page2
-rw-r--r--xslt/mallard/html/mal2html-api.xsl17
2 files changed, 13 insertions, 6 deletions
diff --git a/test/api/func2.page b/test/api/func2.page
index 55068927..64d30dc8 100644
--- a/test/api/func2.page
+++ b/test/api/func2.page
@@ -6,7 +6,7 @@
<info>
<api:function>
<api:returns>
- <api:type>some_type</api:type>
+ <api:type>some_really_long_type_name</api:type>
<api:name>some_name</api:name>
</api:returns>
<api:name>this_is_a_really_long_function_name_that_should_cause_wrapping</api:name>
diff --git a/xslt/mallard/html/mal2html-api.xsl b/xslt/mallard/html/mal2html-api.xsl
index 8be7762f..70e162f6 100644
--- a/xslt/mallard/html/mal2html-api.xsl
+++ b/xslt/mallard/html/mal2html-api.xsl
@@ -35,6 +35,11 @@ extension.
-->
+<!-- not params for now -->
+<xsl:variable name="mal2html.api.tab.c.func" select="20"/>
+<xsl:variable name="mal2html.api.tab.c.args" select="60"/>
+
+
<!--**==========================================================================
mal2html.api.links
Output links as a synopsis for a programming language.
@@ -181,7 +186,7 @@ contains an #{api:function} element in its #{info}.
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- <xsl:variable name="tab" select="20 - string-length($type)"/>
+ <xsl:variable name="tab" select="$mal2html.api.tab.c.func - string-length($type)"/>
<xsl:copy-of select="$type"/>
<xsl:choose>
<xsl:when test="$tab > 1">
@@ -189,7 +194,7 @@ contains an #{api:function} element in its #{info}.
</xsl:when>
<xsl:otherwise>
<xsl:text>&#x000A;</xsl:text>
- <xsl:text> </xsl:text>
+ <xsl:value-of select="str:padding($mal2html.api.tab.c.func)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="name">
@@ -210,20 +215,22 @@ contains an #{api:function} element in its #{info}.
</xsl:attribute>
<xsl:copy-of select="$name"/>
</a>
- <xsl:variable name="paren" select="40 - string-length($name)"/>
+ <xsl:variable name="paren" select="$mal2html.api.tab.c.args -
+ $mal2html.api.tab.c.func -
+ string-length($name)"/>
<xsl:choose>
<xsl:when test="$paren > 1">
<xsl:value-of select="str:padding($paren)"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>&#x000A;</xsl:text>
- <xsl:value-of select="str:padding(60)"/>
+ <xsl:value-of select="str:padding($mal2html.api.tab.c.args)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>(</xsl:text>
<xsl:for-each select="$function/api:arg">
<xsl:if test="position() != 1">
- <xsl:value-of select="str:padding(61)"/>
+ <xsl:value-of select="str:padding($mal2html.api.tab.c.args + 1)"/>
</xsl:if>
<xsl:apply-templates mode="mal2html.inline.mode" select="api:type/node()"/>
<xsl:if test="api:type and (