Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/devmanual:master commit in: /
Date: Mon, 03 Feb 2020 00:07:46
Message-Id: 1580688079.a17eeb5d6403f6e020b1ae7fbe92f6606bb28ed0.ulm@gentoo
1 commit: a17eeb5d6403f6e020b1ae7fbe92f6606bb28ed0
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 29 11:21:52 2020 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 3 00:01:19 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=a17eeb5d
7
8 devbook.xsl: Define relative_path_depth_recursion only once.
9
10 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
11
12 devbook.xsl | 28 +++++++---------------------
13 1 file changed, 7 insertions(+), 21 deletions(-)
14
15 diff --git a/devbook.xsl b/devbook.xsl
16 index be30022..3ff6502 100644
17 --- a/devbook.xsl
18 +++ b/devbook.xsl
19 @@ -437,18 +437,18 @@
20 </xsl:template>
21
22 <xsl:template match="/">
23 + <xsl:variable name="relative_path_depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/>
24 + <xsl:variable name="relative_path_depth_recursion">
25 + <xsl:call-template name="str:repeatString">
26 + <xsl:with-param name="count" select="$relative_path_depth"/>
27 + <xsl:with-param name="append">../</xsl:with-param>
28 + </xsl:call-template>
29 + </xsl:variable>
30 <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
31 <xsl:value-of select='$newline'/>
32 <html lang="en">
33 <head>
34 <title><xsl:value-of select="/guide/chapter[1]/title"/> – Gentoo Development Guide</title>
35 - <xsl:variable name="relative_path_depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/>
36 - <xsl:variable name="relative_path_depth_recursion">
37 - <xsl:call-template name="str:repeatString">
38 - <xsl:with-param name="count" select="$relative_path_depth"/>
39 - <xsl:with-param name="append">../</xsl:with-param>
40 - </xsl:call-template>
41 - </xsl:variable>
42 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
43 <meta name="description" content="The Gentoo Devmanual is a technical manual which covers topics such as writing ebuilds and eclasses, and policies that developers should be abiding by." />
44 <link href="https://assets.gentoo.org/tyrian/bootstrap.min.css" rel="stylesheet" media="screen" />
45 @@ -508,13 +508,6 @@
46 </div>
47 <div class="collapse navbar-collapse navbar-main-collapse">
48 <ul class="nav navbar-nav">
49 - <xsl:variable name="relative_path_depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/>
50 - <xsl:variable name="relative_path_depth_recursion">
51 - <xsl:call-template name="str:repeatString">
52 - <xsl:with-param name="count" select="$relative_path_depth"/>
53 - <xsl:with-param name="append">../</xsl:with-param>
54 - </xsl:call-template>
55 - </xsl:variable>
56 <li><a href="{concat($relative_path_depth_recursion, substring-after(substring-before(@link, '##'), '::'), 'index.html', substring-after(@link, '##'))}"><span class="fa fa-home"/>&#160; Home</a></li>
57 <li class="dropdown">
58 <a href="#" class="dropdown-toggle" data-toggle="dropdown"><xsl:value-of select="/guide/chapter[1]/title"/> <span class="caret"></span></a>
59 @@ -618,13 +611,6 @@
60 <script src="https://assets.gentoo.org/tyrian/jquery.min.js"></script>
61 <script src="https://assets.gentoo.org/tyrian/bootstrap.min.js"></script>
62 <script src="https://assets.gentoo.org/lunr/lunr.min.js"></script>
63 - <xsl:variable name="relative_path_depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/>
64 - <xsl:variable name="relative_path_depth_recursion">
65 - <xsl:call-template name="str:repeatString">
66 - <xsl:with-param name="count" select="$relative_path_depth"/>
67 - <xsl:with-param name="append">../</xsl:with-param>
68 - </xsl:call-template>
69 - </xsl:variable>
70 <script><xsl:text>var documentsSrc = "</xsl:text><xsl:value-of select="$relative_path_depth_recursion"/><xsl:text>documents.js"</xsl:text></script>
71 <script src="{$relative_path_depth_recursion}search.js"></script>
72 </body>