[yelp-xsl/wip/api-1-0] mal2html-api: Make C padding values xsl:variables
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl/wip/api-1-0] mal2html-api: Make C padding values xsl:variables
- Date: Fri, 16 Mar 2012 19:50:21 +0000 (UTC)
commit bfa6c74b7ecf7fdc17ba876619bfefbb185fc422
Author: Shaun McCance <shaunm gnome org>
Date: Fri Mar 16 10:52:47 2012 -0400
mal2html-api: Make C padding values xsl:variables
test/api/func2.page | 2 +-
xslt/mallard/html/mal2html-api.xsl | 17 ++++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/test/api/func2.page b/test/api/func2.page
index 5506892..64d30dc 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 8be7762..70e162f 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>
</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>
</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 (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]