source: stylesheets/xhtml/lfs-mixed.xsl@ 6279d44

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 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 6279d44 was 6279d44, checked in by Bruce Dubbs <bdubbs@…>, 19 years ago

Update url styles

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

  • Property mode set to 100644
File size: 4.4 KB
RevLine 
[5d4975d]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
[3fe8b511]7 <!-- screen -->
[5d4975d]8 <xsl:template match="screen">
9 <xsl:choose>
[3fe8b511]10 <xsl:when test="child::* = userinput">
11 <pre class="userinput">
12 <xsl:apply-templates/>
[5d4975d]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>
[3fe8b511]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
[6279d44]47 <!-- External URLs in class='url' -->
[3fe8b511]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>
[6279d44]56 <span class='url'>
[3fe8b511]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>
[6279d44]65 </span>
[3fe8b511]66 </a>
67 </xsl:template>
68
69 <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
70 isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
71 <xsl:template name="inline.monoseq">
72 <xsl:param name="content">
73 <xsl:call-template name="anchor"/>
74 <xsl:call-template name="simple.xlink">
75 <xsl:with-param name="content">
76 <xsl:apply-templates/>
77 </xsl:with-param>
78 </xsl:call-template>
79 </xsl:param>
80 <tt class="{local-name(.)}">
81 <xsl:if test="@dir">
82 <xsl:attribute name="dir">
83 <xsl:value-of select="@dir"/>
84 </xsl:attribute>
85 </xsl:if>
86 <xsl:copy-of select="$content"/>
87 </tt>
88 </xsl:template>
89
90 <xsl:template name="inline.boldmonoseq">
91 <xsl:param name="content">
92 <xsl:call-template name="anchor"/>
93 <xsl:call-template name="simple.xlink">
94 <xsl:with-param name="content">
95 <xsl:apply-templates/>
96 </xsl:with-param>
97 </xsl:call-template>
98 </xsl:param>
99 <!-- don't put <strong> inside figure, example, or table titles -->
100 <!-- or other titles that may already be represented with <strong>'s. -->
101 <xsl:choose>
102 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
103 or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
104 <tt class="{local-name(.)}">
105 <xsl:if test="@dir">
106 <xsl:attribute name="dir">
107 <xsl:value-of select="@dir"/>
108 </xsl:attribute>
109 </xsl:if>
110 <xsl:copy-of select="$content"/>
111 </tt>
112 </xsl:when>
113 <xsl:otherwise>
114 <strong class="{local-name(.)}">
115 <tt>
116 <xsl:if test="@dir">
117 <xsl:attribute name="dir">
118 <xsl:value-of select="@dir"/>
119 </xsl:attribute>
120 </xsl:if>
121 <xsl:copy-of select="$content"/>
122 </tt>
123 </strong>
124 </xsl:otherwise>
125 </xsl:choose>
126 </xsl:template>
127
128 <xsl:template name="inline.italicmonoseq">
129 <xsl:param name="content">
130 <xsl:call-template name="anchor"/>
131 <xsl:call-template name="simple.xlink">
132 <xsl:with-param name="content">
133 <xsl:apply-templates/>
134 </xsl:with-param>
135 </xsl:call-template>
136 </xsl:param>
137 <em class="{local-name(.)}">
138 <tt>
139 <xsl:if test="@dir">
140 <xsl:attribute name="dir">
141 <xsl:value-of select="@dir"/>
142 </xsl:attribute>
143 </xsl:if>
144 <xsl:copy-of select="$content"/>
145 </tt>
146 </em>
147 </xsl:template>
[5d4975d]148
149</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.