aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devbook.xsl12
-rw-r--r--tasks-reference/completion/text.xml4
2 files changed, 10 insertions, 6 deletions
diff --git a/devbook.xsl b/devbook.xsl
index c2251ae..dafc746 100644
--- a/devbook.xsl
+++ b/devbook.xsl
@@ -90,8 +90,7 @@
<xsl:call-template name="highlight-subtokenate">
<xsl:with-param name="data" select="substring-before(substring-after($data, '--'), ')')"/>
</xsl:call-template>
- </span>
- )<xsl:value-of select="substring-after(substring-after($data, '--'), ')')"/>
+ </span>)<xsl:value-of select="substring-after(substring-after($data, '--'), ')')"/>
</xsl:when>
<xsl:otherwise>
<span class="Comment">
@@ -520,10 +519,15 @@
<!-- FIXME: Handle lang=... -->
<xsl:template match="codesample">
<pre><span class="Constant">
+ <xsl:variable name="numbering" select="@numbering"/>
<xsl:for-each select="str:tokenize_plasmaroo(., $newline)">
<xsl:choose>
- <xsl:when test=". = $newline and position() = 1"/>
- <xsl:when test=". = $newline"><xsl:value-of select='$newline'/></xsl:when>
+ <xsl:when test=". = $newline">
+ <xsl:if test="position() != 1"><xsl:value-of select='$newline'/></xsl:if>
+ <xsl:if test="$numbering = 'lines' and position() != last()-1">
+ <span style="float: left;"><xsl:number format="01"/>:<xsl:text> </xsl:text></span>
+ </xsl:if>
+ </xsl:when>
<xsl:otherwise>
<!-- <xsl:if test="position() != 1"><xsl:value-of select='$newline'/></xsl:if> -->
<xsl:call-template name="highlight-tokenate">
diff --git a/tasks-reference/completion/text.xml b/tasks-reference/completion/text.xml
index 216b293..7de4101 100644
--- a/tasks-reference/completion/text.xml
+++ b/tasks-reference/completion/text.xml
@@ -160,7 +160,7 @@ Nearly all completion functions will start out the same way. For these cases,
the following can be used as a template for creating new completion functions:
</p>
-<codesample lang="ebuild">
+<codesample lang="ebuild" numbering="lines">
_foo() {
local cur prev opts
COMPREPLY=()
@@ -302,7 +302,7 @@ real completion function for <c>revdep-rebuild</c> (might even be available in
<c>gentoo-bashcomp</c> by the time you read this :]).
</p>
-<codesample lang="ebuild">
+<codesample lang="ebuild" numbering="lines">
_revdep_rebuild() {
local cur prev opts
COMPREPLY=()