source: stylesheets/xhtml/lfs-sections.xsl@ f7bd105

10.0 10.0-rc1 10.1 10.1-rc1 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 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 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 f7bd105 was f7bd105, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Updated the stylesheets and Makefile.
Removed contrib/, index-pdf.xml and goTidy.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4428 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.5 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 <!-- Sect1 attributes -->
9 <xsl:template match="sect1">
10 <div>
11 <xsl:choose>
12 <xsl:when test="@role">
13 <xsl:attribute name="class">
14 <xsl:value-of select="@role"/>
15 </xsl:attribute>
16 </xsl:when>
17 <xsl:otherwise>
18 <xsl:attribute name="class">
19 <xsl:value-of select="name(.)"/>
20 </xsl:attribute>
21 </xsl:otherwise>
22 </xsl:choose>
23 <xsl:call-template name="language.attribute"/>
24 <xsl:call-template name="sect1.titlepage"/>
25 <xsl:apply-templates/>
26 <xsl:call-template name="process.chunk.footnotes"/>
27 </div>
28 </xsl:template>
29
30 <!-- Sect2 attributes -->
31 <xsl:template match="sect2">
32 <div>
33 <xsl:choose>
34 <xsl:when test="@role">
35 <xsl:attribute name="class">
36 <xsl:value-of select="@role"/>
37 </xsl:attribute>
38 </xsl:when>
39 <xsl:otherwise>
40 <xsl:attribute name="class">
41 <xsl:value-of select="name(.)"/>
42 </xsl:attribute>
43 </xsl:otherwise>
44 </xsl:choose>
45 <xsl:call-template name="language.attribute"/>
46 <xsl:call-template name="sect2.titlepage"/>
47 <xsl:apply-templates/>
48 <xsl:call-template name="process.chunk.footnotes"/>
49 </div>
50 </xsl:template>
51
52 <!-- Sections numbering -->
53 <xsl:param name="section.autolabel" select="1"/>
54 <xsl:param name="section.label.includes.component.label" select="1"/>
55
56 <!-- Skip numeraration for sections with empty title -->
57 <xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup">
58 <xsl:if test="string-length(title) > 0">
59 <!-- label the parent -->
60 <xsl:variable name="parent.label">
61 <xsl:apply-templates select=".." mode="label.markup"/>
62 </xsl:variable>
63 <xsl:if test="$parent.label != ''">
64 <xsl:apply-templates select=".." mode="label.markup"/>
65 <xsl:apply-templates select=".." mode="intralabel.punctuation"/>
66 </xsl:if>
67 <xsl:choose>
68 <xsl:when test="@label">
69 <xsl:value-of select="@label"/>
70 </xsl:when>
71 <xsl:when test="$section.autolabel != 0">
72 <xsl:choose>
73 <xsl:when test="local-name(.) = 'sect2'">
74 <xsl:choose>
75 <!-- If the first sect2 isn't numbered, renumber the remainig sections -->
76 <xsl:when test="string-length(../sect2[1]/title) = 0">
77 <xsl:variable name="totalsect2">
78 <xsl:number count="sect2"/>
79 </xsl:variable>
80 <xsl:number value="$totalsect2 - 1"/>
81 </xsl:when>
82 <xsl:otherwise>
83 <xsl:number count="sect2"/>
84 </xsl:otherwise>
85 </xsl:choose>
86 </xsl:when>
87 <xsl:when test="local-name(.) = 'sect3'">
88 <xsl:number count="sect3"/>
89 </xsl:when>
90 <xsl:when test="local-name(.) = 'sect4'">
91 <xsl:number count="sect4"/>
92 </xsl:when>
93 <xsl:when test="local-name(.) = 'sect5'">
94 <xsl:number count="sect5"/>
95 </xsl:when>
96 <xsl:otherwise>
97 <xsl:message>label.markup: this can't happen!</xsl:message>
98 </xsl:otherwise>
99 </xsl:choose>
100 </xsl:when>
101 </xsl:choose>
102 </xsl:if>
103 </xsl:template>
104
105</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.