summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2014-06-06 14:41:03 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-18 13:48:38 +0100
commit74551392b3f4209d2dff83cd783657c15eec811b (patch)
tree19c0a2ef1d671c898e22f7120a2b63fd4fa2bc20 /bitbake
parentc65de86d81d834bfefd5d27cf471a842485a7655 (diff)
downloadpoky-74551392b3f4209d2dff83cd783657c15eec811b.tar.gz
bitbake: bitbake-user-manual: Added permalink support.
Fixes [YOCTO #5772] I added the five XSL templates to the template folder. I updated the bitbake-user-manual-customization.xsl layer file to include the new templates. (Bitbake rev: e1c24a79ededb2dd4ac5ce09fcfdf93218261907) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl6
-rw-r--r--bitbake/doc/template/component.title.xsl39
-rw-r--r--bitbake/doc/template/division.title.xsl24
-rw-r--r--bitbake/doc/template/formal.object.heading.xsl21
-rw-r--r--bitbake/doc/template/permalinks.xsl25
-rw-r--r--bitbake/doc/template/section.title.xsl55
6 files changed, 170 insertions, 0 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl
index b17dd0f208..886e56e12f 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl
@@ -3,6 +3,12 @@
3 3
4 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> 4 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" />
5 5
6 <xsl:include href="../template/permalinks.xsl"/>
7 <xsl:include href="../template/section.title.xsl"/>
8 <xsl:include href="../template/component.title.xsl"/>
9 <xsl:include href="../template/division.title.xsl"/>
10 <xsl:include href="../template/formal.object.heading.xsl"/>
11
6 <xsl:param name="html.stylesheet" select="'user-manual-style.css'" /> 12 <xsl:param name="html.stylesheet" select="'user-manual-style.css'" />
7 <xsl:param name="chapter.autolabel" select="1" /> 13 <xsl:param name="chapter.autolabel" select="1" />
8 <xsl:param name="section.autolabel" select="1" /> 14 <xsl:param name="section.autolabel" select="1" />
diff --git a/bitbake/doc/template/component.title.xsl b/bitbake/doc/template/component.title.xsl
new file mode 100644
index 0000000000..3a5539dc83
--- /dev/null
+++ b/bitbake/doc/template/component.title.xsl
@@ -0,0 +1,39 @@
1<xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:d="http://docbook.org/ns/docbook"
4 xmlns="http://www.w3.org/1999/xhtml"
5 exclude-result-prefixes="d">
6
7 <xsl:template name="component.title">
8 <xsl:param name="node" select="."/>
9
10 <xsl:variable name="level">
11 <xsl:choose>
12 <xsl:when test="ancestor::d:section">
13 <xsl:value-of select="count(ancestor::d:section)+1"/>
14 </xsl:when>
15 <xsl:when test="ancestor::d:sect5">6</xsl:when>
16 <xsl:when test="ancestor::d:sect4">5</xsl:when>
17 <xsl:when test="ancestor::d:sect3">4</xsl:when>
18 <xsl:when test="ancestor::d:sect2">3</xsl:when>
19 <xsl:when test="ancestor::d:sect1">2</xsl:when>
20 <xsl:otherwise>1</xsl:otherwise>
21 </xsl:choose>
22 </xsl:variable>
23 <xsl:element name="h{$level+1}" namespace="http://www.w3.org/1999/xhtml">
24 <xsl:attribute name="class">title</xsl:attribute>
25 <xsl:if test="$generate.id.attributes = 0">
26 <xsl:call-template name="anchor">
27 <xsl:with-param name="node" select="$node"/>
28 <xsl:with-param name="conditional" select="0"/>
29 </xsl:call-template>
30 </xsl:if>
31 <xsl:apply-templates select="$node" mode="object.title.markup">
32 <xsl:with-param name="allow-anchors" select="1"/>
33 </xsl:apply-templates>
34 <xsl:call-template name="permalink">
35 <xsl:with-param name="node" select="$node"/>
36 </xsl:call-template>
37 </xsl:element>
38 </xsl:template>
39</xsl:stylesheet> \ No newline at end of file
diff --git a/bitbake/doc/template/division.title.xsl b/bitbake/doc/template/division.title.xsl
new file mode 100644
index 0000000000..8cd70a595b
--- /dev/null
+++ b/bitbake/doc/template/division.title.xsl
@@ -0,0 +1,24 @@
1<xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:d="http://docbook.org/ns/docbook"
4 xmlns="http://www.w3.org/1999/xhtml"
5 exclude-result-prefixes="d">
6
7 <xsl:template name="division.title">
8 <xsl:param name="node" select="."/>
9
10 <h1>
11 <xsl:attribute name="class">title</xsl:attribute>
12 <xsl:call-template name="anchor">
13 <xsl:with-param name="node" select="$node"/>
14 <xsl:with-param name="conditional" select="0"/>
15 </xsl:call-template>
16 <xsl:apply-templates select="$node" mode="object.title.markup">
17 <xsl:with-param name="allow-anchors" select="1"/>
18 </xsl:apply-templates>
19 <xsl:call-template name="permalink">
20 <xsl:with-param name="node" select="$node"/>
21 </xsl:call-template>
22 </h1>
23 </xsl:template>
24</xsl:stylesheet> \ No newline at end of file
diff --git a/bitbake/doc/template/formal.object.heading.xsl b/bitbake/doc/template/formal.object.heading.xsl
new file mode 100644
index 0000000000..4f3900d165
--- /dev/null
+++ b/bitbake/doc/template/formal.object.heading.xsl
@@ -0,0 +1,21 @@
1<xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:d="http://docbook.org/ns/docbook"
4 xmlns="http://www.w3.org/1999/xhtml"
5 exclude-result-prefixes="d">
6
7 <xsl:template name="formal.object.heading">
8 <xsl:param name="object" select="."/>
9 <xsl:param name="title">
10 <xsl:apply-templates select="$object" mode="object.title.markup">
11 <xsl:with-param name="allow-anchors" select="1"/>
12 </xsl:apply-templates>
13 </xsl:param>
14 <p class="title">
15 <b><xsl:copy-of select="$title"/></b>
16 <xsl:call-template name="permalink">
17 <xsl:with-param name="node" select="$object"/>
18 </xsl:call-template>
19 </p>
20 </xsl:template>
21</xsl:stylesheet> \ No newline at end of file
diff --git a/bitbake/doc/template/permalinks.xsl b/bitbake/doc/template/permalinks.xsl
new file mode 100644
index 0000000000..d2a1c14524
--- /dev/null
+++ b/bitbake/doc/template/permalinks.xsl
@@ -0,0 +1,25 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns="http://www.w3.org/1999/xhtml"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
6 <xsl:param name="generate.permalink" select="1"/>
7 <xsl:param name="permalink.text">ΒΆ</xsl:param>
8
9 <xsl:template name="permalink">
10 <xsl:param name="node"/>
11
12 <xsl:if test="$generate.permalink != '0'">
13 <span class="permalink">
14 <a alt="Permalink" title="Permalink">
15 <xsl:attribute name="href">
16 <xsl:call-template name="href.target">
17 <xsl:with-param name="object" select="$node"/>
18 </xsl:call-template>
19 </xsl:attribute>
20 <xsl:copy-of select="$permalink.text"/>
21 </a>
22 </span>
23 </xsl:if>
24 </xsl:template>
25</xsl:stylesheet>
diff --git a/bitbake/doc/template/section.title.xsl b/bitbake/doc/template/section.title.xsl
new file mode 100644
index 0000000000..5c6ff9a96e
--- /dev/null
+++ b/bitbake/doc/template/section.title.xsl
@@ -0,0 +1,55 @@
1<xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:d="http://docbook.org/ns/docbook"
4 xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="d">
5
6 <xsl:template name="section.title">
7 <xsl:variable name="section"
8 select="(ancestor::section |
9 ancestor::simplesect|
10 ancestor::sect1|
11 ancestor::sect2|
12 ancestor::sect3|
13 ancestor::sect4|
14 ancestor::sect5)[last()]"/>
15
16 <xsl:variable name="renderas">
17 <xsl:choose>
18 <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
19 <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
20 <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
21 <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
22 <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
23 <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
24 </xsl:choose>
25 </xsl:variable>
26
27 <xsl:variable name="level">
28 <xsl:choose>
29 <xsl:when test="$renderas != ''">
30 <xsl:value-of select="$renderas"/>
31 </xsl:when>
32 <xsl:otherwise>
33 <xsl:call-template name="section.level">
34 <xsl:with-param name="node" select="$section"/>
35 </xsl:call-template>
36 </xsl:otherwise>
37 </xsl:choose>
38 </xsl:variable>
39
40 <xsl:call-template name="section.heading">
41 <xsl:with-param name="section" select="$section"/>
42 <xsl:with-param name="level" select="$level"/>
43 <xsl:with-param name="title">
44 <xsl:apply-templates select="$section" mode="object.title.markup">
45 <xsl:with-param name="allow-anchors" select="1"/>
46 </xsl:apply-templates>
47 <xsl:if test="$level &gt; 0">
48 <xsl:call-template name="permalink">
49 <xsl:with-param name="node" select="$section"/>
50 </xsl:call-template>
51 </xsl:if>
52 </xsl:with-param>
53 </xsl:call-template>
54 </xsl:template>
55</xsl:stylesheet>