source: stylesheets/xhtml/lfs-mixed.xsl@ ad825f2

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 upgradedb xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since ad825f2 was ad825f2, checked in by Bruce Dubbs <bdubbs@…>, 17 years ago

Tagging for freeglut. Updates to xsl/css to format contents better.

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

  • Property mode set to 100644
File size: 5.2 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 <!-- screen -->
8 <xsl:template match="screen">
9 <xsl:choose>
10 <xsl:when test="child::* = userinput">
11 <pre class="userinput">
12 <xsl:apply-templates/>
13 </pre>
14 </xsl:when>
15 <xsl:otherwise>
16 <pre class="{name(.)}">
17 <xsl:apply-templates/>
18 </pre>
19 </xsl:otherwise>
20 </xsl:choose>
21 </xsl:template>
22
23 <!-- userinput -->
24 <xsl:template match="userinput">
25 <xsl:choose>
26 <xsl:when test="ancestor::screen">
27 <kbd class="command">
28 <xsl:apply-templates/>
29 </kbd>
30 </xsl:when>
31 <xsl:otherwise>
32 <xsl:apply-imports/>
33 </xsl:otherwise>
34 </xsl:choose>
35 </xsl:template>
36
37 <!-- Body attributes -->
38 <xsl:template name="body.attributes">
39 <xsl:attribute name="id">
40 <xsl:text>blfs</xsl:text>
41 </xsl:attribute>
42 <xsl:attribute name="class">
43 <xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/>
44 </xsl:attribute>
45 </xsl:template>
46
47 <!-- External URLs in class='url' -->
48 <xsl:template match="ulink" name="ulink">
49 <a>
50 <xsl:if test="@id">
51 <xsl:attribute name="id">
52 <xsl:value-of select="@id"/>
53 </xsl:attribute>
54 </xsl:if>
55 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
56 <span class='url'>
57 <xsl:choose>
58 <xsl:when test="count(child::node())=0">
59 <xsl:value-of select="@url"/>
60 </xsl:when>
61 <xsl:otherwise>
62 <xsl:apply-templates/>
63 </xsl:otherwise>
64 </xsl:choose>
65 </span>
66 </a>
67 </xsl:template>
68
69 <!-- Cunstomizing segementedlist -->
70 <xsl:template match="seg">
71 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
72 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
73 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
74 <!-- Note: segtitle is only going to be the right thing in a well formed
75 SegmentedList. If there are too many Segs or too few SegTitles,
76 you'll get something odd...maybe an error -->
77 <div class="seg">
78 <strong>
79 <span class="segtitle">
80 <xsl:apply-templates select="$segtitles[$segnum=position()]"
81 mode="segtitle-in-seg"/>
82 <xsl:text>: </xsl:text>
83 </span>
84 </strong>
85 <span class="seg">
86 <xsl:apply-templates/>
87 </span>
88 </div>
89 </xsl:template>
90
91 <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
92 isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
93 <xsl:template name="inline.monoseq">
94 <xsl:param name="content">
95 <xsl:call-template name="anchor"/>
96 <xsl:call-template name="simple.xlink">
97 <xsl:with-param name="content">
98 <xsl:apply-templates/>
99 </xsl:with-param>
100 </xsl:call-template>
101 </xsl:param>
102 <tt class="{local-name(.)}">
103 <xsl:if test="@dir">
104 <xsl:attribute name="dir">
105 <xsl:value-of select="@dir"/>
106 </xsl:attribute>
107 </xsl:if>
108 <xsl:copy-of select="$content"/>
109 </tt>
110 </xsl:template>
111
112 <xsl:template name="inline.boldmonoseq">
113 <xsl:param name="content">
114 <xsl:call-template name="anchor"/>
115 <xsl:call-template name="simple.xlink">
116 <xsl:with-param name="content">
117 <xsl:apply-templates/>
118 </xsl:with-param>
119 </xsl:call-template>
120 </xsl:param>
121 <!-- don't put <strong> inside figure, example, or table titles -->
122 <!-- or other titles that may already be represented with <strong>'s. -->
123 <xsl:choose>
124 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
125 or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
126 <tt class="{local-name(.)}">
127 <xsl:if test="@dir">
128 <xsl:attribute name="dir">
129 <xsl:value-of select="@dir"/>
130 </xsl:attribute>
131 </xsl:if>
132 <xsl:copy-of select="$content"/>
133 </tt>
134 </xsl:when>
135 <xsl:otherwise>
136 <strong class="{local-name(.)}">
137 <tt>
138 <xsl:if test="@dir">
139 <xsl:attribute name="dir">
140 <xsl:value-of select="@dir"/>
141 </xsl:attribute>
142 </xsl:if>
143 <xsl:copy-of select="$content"/>
144 </tt>
145 </strong>
146 </xsl:otherwise>
147 </xsl:choose>
148 </xsl:template>
149
150 <xsl:template name="inline.italicmonoseq">
151 <xsl:param name="content">
152 <xsl:call-template name="anchor"/>
153 <xsl:call-template name="simple.xlink">
154 <xsl:with-param name="content">
155 <xsl:apply-templates/>
156 </xsl:with-param>
157 </xsl:call-template>
158 </xsl:param>
159 <em class="{local-name(.)}">
160 <tt>
161 <xsl:if test="@dir">
162 <xsl:attribute name="dir">
163 <xsl:value-of select="@dir"/>
164 </xsl:attribute>
165 </xsl:if>
166 <xsl:copy-of select="$content"/>
167 </tt>
168 </em>
169 </xsl:template>
170
171</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.