aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Meier <maekke@gentoo.org>2014-07-22 20:58:16 +0200
committerMarkus Meier <maekke@gentoo.org>2014-07-22 20:58:16 +0200
commitda6d9033572e33673be0eb14bbb39687d6fb50ca (patch)
tree0c92475b7739beb63b4fff3fddd5bf2e2a13739f /devbook.xsl
parentAdd jquery and bootstrap .js files (diff)
downloaddevmanual-da6d9033572e33673be0eb14bbb39687d6fb50ca.tar.gz
devmanual-da6d9033572e33673be0eb14bbb39687d6fb50ca.tar.bz2
devmanual-da6d9033572e33673be0eb14bbb39687d6fb50ca.zip
Show current page location under the menu
- Use the breadcrump component of bootstrap - Add printParentDocs template to generate the entries recursively
Diffstat (limited to 'devbook.xsl')
-rw-r--r--devbook.xsl32
1 files changed, 32 insertions, 0 deletions
diff --git a/devbook.xsl b/devbook.xsl
index 98206e8..1d72520 100644
--- a/devbook.xsl
+++ b/devbook.xsl
@@ -494,6 +494,18 @@
</nav>
</header>
<div class="container">
+ <div class="row">
+ <div class="col-md010">
+ <ol class="breadcrumb">
+ <xsl:call-template name="printParentDocs">
+ <xsl:with-param name="path" select="/guide/@self"/>
+ <xsl:with-param name="depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/>
+ </xsl:call-template>
+ </ol>
+ </div>
+ </div>
+ </div>
+ <div class="container">
<xsl:apply-templates/>
</div>
<footer>
@@ -660,6 +672,26 @@
</xsl:choose>
</xsl:template>
+ <xsl:template name="printParentDocs">
+ <xsl:param name="depth"/>
+ <xsl:choose>
+ <xsl:when test="$depth &gt; 0">
+ <xsl:variable name="relative_path_depth_recursion">
+ <xsl:call-template name="str:repeatString">
+ <xsl:with-param name="count" select="$depth"/>
+ <xsl:with-param name="append">../</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <li><a href="{$relative_path_depth_recursion}index.html"><xsl:value-of select="document(concat(/guide/@self, concat($relative_path_depth_recursion, 'text.xml')))/guide/chapter[1]/title"/></a></li>
+
+ <xsl:call-template name="printParentDocs">
+ <xsl:with-param name="depth" select="$depth - 1"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
<xsl:template name="findParent">
<xsl:choose>
<xsl:when test="not(/guide/@root)">