source: stylesheets/xhtml/lfs-toc.xsl@ 276015d2

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 276015d2 was 276015d2, checked in by Randy McMurchy <randy@…>, 17 years ago

Added the LastChangedBy and Date keywords then set the corresponding keyword property on each file in the repo

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

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