source: stylesheets/lfs-xsl/xhtml/lfs-titles.xsl@ 52dcb7d

11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 52dcb7d was 52dcb7d, checked in by Xℹ Ruoyao <xry111@…>, 3 years ago

remove $Date$ and $LastChangedBy$

They are unsupported by Git.

  • Property mode set to 100644
File size: 6.6 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 <!-- This stylesheet controls the h* xhtml tags used for several titles -->
8
9 <!-- preface.titlepage:
10 Uses h1 and removed a lot of unneeded code.
11 No label in preface. -->
12 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
13 <xsl:template name="preface.titlepage">
14 <h1 class="{name(.)}">
15 <xsl:if test="@id">
16 <a id="{@id}" name="{@id}"/>
17 </xsl:if>
18 <xsl:value-of select="title"/>
19 </h1>
20 </xsl:template>
21
22 <!-- part.titlepage:
23 Uses h1 and removed a lot of unneeded code.
24 When sections are not labeled, we want the part label in TOC
25 but not in titlepage. -->
26 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
27 <xsl:template name="part.titlepage">
28 <h1 class="{name(.)}">
29 <xsl:if test="@id">
30 <a id="{@id}" name="{@id}"/>
31 </xsl:if>
32 <xsl:if test="$section.autolabel != 0">
33 <xsl:apply-templates select="." mode="label.markup"/>
34 <xsl:text>. </xsl:text>
35 </xsl:if>
36 <xsl:value-of select="title"/>
37 </h1>
38 </xsl:template>
39
40 <!-- partintro.titlepage:
41 Uses h2 and removed a lot of unneeded code. -->
42 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
43 <xsl:template name="partintro.titlepage">
44 <xsl:if test="title">
45 <h2 class="{name(.)}">
46 <xsl:if test="@id">
47 <a id="{@id}" name="{@id}"/>
48 </xsl:if>
49 <xsl:value-of select="title"/>
50 </h2>
51 </xsl:if>
52 </xsl:template>
53
54 <!-- appendix.titlepage:
55 Uses h1 and removed a lot of unneeded code.
56 When sections are not labeled, we want the appendix label in TOC
57 but not in titlepage. -->
58 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
59 <xsl:template name="appendix.titlepage">
60 <h1 class="{name(.)}">
61 <xsl:if test="@id">
62 <a id="{@id}" name="{@id}"/>
63 </xsl:if>
64 <xsl:if test="$section.autolabel != 0">
65 <xsl:apply-templates select="." mode="label.markup"/>
66 <xsl:text>. </xsl:text>
67 </xsl:if>
68 <xsl:value-of select="title"/>
69 </h1>
70 </xsl:template>
71
72 <!-- chapter.titlepage:
73 Uses h1 and removed a lot of unneeded code.
74 When sections are not labeled, we want the chapter label in TOC
75 but not in titlepage. -->
76 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
77 <xsl:template name="chapter.titlepage">
78 <h1 class="{name(.)}">
79 <xsl:if test="@id">
80 <a id="{@id}" name="{@id}"/>
81 </xsl:if>
82 <xsl:if test="$section.autolabel != 0">
83 <xsl:apply-templates select="." mode="label.markup"/>
84 <xsl:text>. </xsl:text>
85 </xsl:if>
86 <xsl:value-of select="title"/>
87 </h1>
88 </xsl:template>
89
90 <!-- sect1.titlepage:
91 Uses h1 and removed a lot of unneeded code. -->
92 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
93 <xsl:template name="sect1.titlepage">
94 <h1 class="{name(.)}">
95 <xsl:if test="@id">
96 <a id="{@id}" name="{@id}"/>
97 </xsl:if>
98 <xsl:if test="$section.autolabel != 0">
99 <xsl:apply-templates select="." mode="label.markup"/>
100 <xsl:text>. </xsl:text>
101 </xsl:if>
102 <xsl:value-of select="title"/>
103 </h1>
104 </xsl:template>
105
106 <!-- sect2.titlepage:
107 Uses h2 and removed a lot of unneeded code.
108 Skip empty titles.
109 No label in preface. -->
110 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
111 <xsl:template name="sect2.titlepage">
112 <xsl:choose>
113 <xsl:when test="string-length(title) = 0"/>
114 <xsl:otherwise>
115 <h2 class="{name(.)}">
116 <xsl:if test="@id">
117 <a id="{@id}" name="{@id}"/>
118 </xsl:if>
119 <xsl:if test="not(ancestor::preface) and $section.autolabel != 0">
120 <xsl:apply-templates select="." mode="label.markup"/>
121 <xsl:text>. </xsl:text>
122 </xsl:if>
123 <xsl:value-of select="title"/>
124 </h2>
125 </xsl:otherwise>
126 </xsl:choose>
127 </xsl:template>
128
129 <!-- sect3.titlepage:
130 Uses h3 and removed a lot of unneeded code. -->
131 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
132 <xsl:template name="sect3.titlepage">
133 <h3 class="{name(.)}">
134 <xsl:if test="@id">
135 <a id="{@id}" name="{@id}"/>
136 </xsl:if>
137 <xsl:if test="$section.autolabel != 0">
138 <xsl:apply-templates select="." mode="label.markup"/>
139 <xsl:text>. </xsl:text>
140 </xsl:if>
141 <xsl:value-of select="title"/>
142 </h3>
143 </xsl:template>
144
145 <!-- dedication.titlepage:
146 Uses h2 and removed a lot of unneeded code. -->
147 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
148 <xsl:template name="dedication.titlepage">
149 <h2>
150 <xsl:value-of select="title"/>
151 </h2>
152 </xsl:template>
153
154 <!-- bridgehead:
155 We use always renderas attributes and want the output h* level
156 matching the defined sect* level.
157 Create the anchor only if there is an @id. -->
158 <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
159 <xsl:template match="bridgehead">
160 <xsl:variable name="hlevel">
161 <xsl:choose>
162 <xsl:when test="@renderas = 'sect1'">1</xsl:when>
163 <xsl:when test="@renderas = 'sect2'">2</xsl:when>
164 <xsl:when test="@renderas = 'sect3'">3</xsl:when>
165 <xsl:when test="@renderas = 'sect4'">4</xsl:when>
166 <xsl:when test="@renderas = 'sect5'">5</xsl:when>
167 </xsl:choose>
168 </xsl:variable>
169 <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
170 <xsl:if test="@id">
171 <a id="{@id}" name="{@id}"/>
172 </xsl:if>
173 <xsl:apply-templates/>
174 </xsl:element>
175 </xsl:template>
176
177 <!-- book.titlepage.verso:
178 Process bookinfo/bibliosource from here. -->
179 <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
180 <xsl:template name="book.titlepage.verso">
181 <xsl:apply-templates select="bookinfo/bibliosource"/>
182 </xsl:template>
183
184 <!-- bookinfo/bibliosource:
185 Self-made template to handle bibliosource when inside bookinfo. -->
186 <xsl:template match="bookinfo/bibliosource">
187 <p class="copyright">
188 <xsl:apply-templates/>
189 </p>
190 </xsl:template>
191
192</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.