source: stylesheets/xhtml/lfs-toc.xsl@ e7ce829

10.0 10.1 11.0 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since e7ce829 was e7ce829, checked in by Bruce Dubbs <bdubbs@…>, 17 years ago

Updates to stylesheeds from Manuel

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3415 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 5.1 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns="http://www.w3.org/1999/xhtml"
5 version="1.0">
6
7 <!-- General settings -->
8 <xsl:param name="generate.toc">
9 appendix toc
10 book toc,title,figure,table,example,equation
11 chapter nop
12 part toc
13 preface nop
14 qandadiv nop
15 qandaset nop
16 reference nop
17 sect1 nop
18 sect2 nop
19 sect3 nop
20 sect4 nop
21 sect5 nop
22 section nop
23 set nop
24 </xsl:param>
25
26 <xsl:param name="toc.section.depth">1</xsl:param>
27
28 <xsl:param name="toc.max.depth">3</xsl:param>
29
30 <!-- Making the TOC -->
31 <xsl:template name="make.toc">
32 <xsl:param name="toc-context" select="."/>
33 <xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
34 <xsl:if test="$nodes">
35 <div class="toc">
36 <h3>
37 <xsl:call-template name="gentext">
38 <xsl:with-param name="key">TableofContents</xsl:with-param>
39 </xsl:call-template>
40 </h3>
41 <ul>
42 <xsl:apply-templates select="$nodes" mode="toc">
43 <xsl:with-param name="toc-context" select="$toc-context"/>
44 </xsl:apply-templates>
45 </ul>
46 </div>
47 </xsl:if>
48 </xsl:template>
49
50 <!-- Making the subtocs -->
51 <xsl:template name="subtoc">
52 <xsl:param name="toc-context" select="."/>
53 <xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
54 <xsl:variable name="subtoc">
55 <ul>
56 <xsl:apply-templates mode="toc" select="$nodes">
57 <xsl:with-param name="toc-context" select="$toc-context"/>
58 </xsl:apply-templates>
59 </ul>
60 </xsl:variable>
61 <xsl:variable name="depth">
62 <xsl:choose>
63 <xsl:when test="local-name(.) = 'sect1'">1</xsl:when>
64 <xsl:otherwise>0</xsl:otherwise>
65 </xsl:choose>
66 </xsl:variable>
67 <xsl:variable name="depth.from.context"
68 select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
69 <li class="{name(.)}">
70 <xsl:call-template name="toc.line">
71 <xsl:with-param name="toc-context" select="$toc-context"/>
72 </xsl:call-template>
73 <xsl:if test="$toc.section.depth &gt; $depth and count($nodes)&gt;0
74 and $toc.max.depth &gt; $depth.from.context">
75 <xsl:copy-of select="$subtoc"/>
76 </xsl:if>
77 </li>
78 </xsl:template>
79
80 <!--Adding the h* tags -->
81 <xsl:template name="toc.line">
82 <xsl:param name="toc-context" select="."/>
83 <xsl:param name="depth" select="1"/>
84 <xsl:param name="depth.from.context" select="8"/>
85 <xsl:choose>
86 <xsl:when test="local-name(.) = 'sect1'">
87 <a>
88 <xsl:attribute name="href">
89 <xsl:call-template name="href.target">
90 <xsl:with-param name="context" select="$toc-context"/>
91 </xsl:call-template>
92 </xsl:attribute>
93 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
94 </a>
95 </xsl:when>
96 <xsl:when test="local-name(.) = 'chapter' or local-name(.) = 'preface'">
97 <h4>
98 <a>
99 <xsl:attribute name="href">
100 <xsl:call-template name="href.target">
101 <xsl:with-param name="context" select="$toc-context"/>
102 </xsl:call-template>
103 </xsl:attribute>
104 <xsl:variable name="label">
105 <xsl:apply-templates select="." mode="label.markup"/>
106 </xsl:variable>
107 <xsl:copy-of select="$label"/>
108 <xsl:if test="$label != ''">
109 <xsl:value-of select="$autotoc.label.separator"/>
110 </xsl:if>
111 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
112 </a>
113 </h4>
114 </xsl:when>
115 <xsl:when test="local-name(.) = 'part'">
116 <h3>
117 <a>
118 <xsl:attribute name="href">
119 <xsl:call-template name="href.target">
120 <xsl:with-param name="context" select="$toc-context"/>
121 </xsl:call-template>
122 </xsl:attribute>
123 <xsl:variable name="label">
124 <xsl:apply-templates select="." mode="label.markup"/>
125 </xsl:variable>
126 <xsl:copy-of select="$label"/>
127 <xsl:if test="$label != ''">
128 <xsl:value-of select="$autotoc.label.separator"/>
129 </xsl:if>
130 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
131 </a>
132 </h3>
133 </xsl:when>
134 <xsl:otherwise>
135 <h3>
136 <a>
137 <xsl:attribute name="href">
138 <xsl:call-template name="href.target">
139 <xsl:with-param name="context" select="$toc-context"/>
140 </xsl:call-template>
141 </xsl:attribute>
142 <xsl:variable name="label">
143 <xsl:apply-templates select="." mode="label.markup"/>
144 </xsl:variable>
145 <xsl:copy-of select="$label"/>
146 <xsl:if test="$label != ''">
147 <xsl:value-of select="$autotoc.label.separator"/>
148 </xsl:if>
149 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
150 </a>
151 </h3>
152 </xsl:otherwise>
153 </xsl:choose>
154 </xsl:template>
155
156</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.