Commit | Line | Data |
---|---|---|
168e428f PH |
1 | <!-- $Cambridge: exim/doc/doc-docbook/MyStyle-html.xsl,v 1.1 2005/06/16 10:32:31 ph10 Exp $ --> |
2 | ||
3 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> | |
4 | ||
5 | <!-- This stylesheet driver imports my common stylesheet that makes some | |
6 | changes that are wanted for all forms of output. Then it makes changes that are | |
7 | specific to HTML output. --> | |
8 | ||
9 | <xsl:import href="MyStyle.xsl"/> | |
10 | ||
11 | <xsl:param name="shade.verbatim" select="1"></xsl:param> | |
12 | ||
13 | <xsl:attribute-set name="shade.verbatim.style"> | |
14 | <xsl:attribute name="bgcolor">#F0F0E0</xsl:attribute> | |
15 | <xsl:attribute name="width">100%</xsl:attribute> | |
16 | <xsl:attribute name="cellpadding">2</xsl:attribute> | |
17 | <xsl:attribute name="border">0</xsl:attribute> | |
18 | </xsl:attribute-set> | |
19 | ||
20 | <!-- This is how you can make use of a CSS stylesheet, but at present I'm | |
21 | not doing so. --> | |
22 | ||
23 | <!-- | |
24 | <xsl:param name="html.stylesheet" select="'Myhtml.css'"/> | |
25 | --> | |
26 | ||
27 | ||
28 | <!-- This removes the title of the current page from the top of the page - | |
29 | redundant because each page is a chapter, whose title shows just below. It also | |
30 | removes the titles of the next/prev at the bottom of the page, but I don't | |
31 | think that matters too much. --> | |
32 | ||
33 | <xsl:param name="navig.showtitles" select="'0'"/> | |
34 | ||
35 | ||
36 | <!-- This allows for the setting of RevisionFlag on elements. --> | |
37 | ||
38 | <xsl:param name="show.revisionflag" select="'1'"/> | |
39 | ||
40 | <xsl:template name="system.head.content"> | |
41 | <style type="text/css"> | |
42 | <xsl:text> | |
43 | div.added { background-color: #ffff99; } | |
44 | div.deleted { text-decoration: line-through; | |
45 | background-color: #FF7F7F; } | |
46 | div.changed { background-color: #99ff99; } | |
47 | div.off { } | |
48 | ||
49 | span.added { background-color: #ffff99; } | |
50 | span.deleted { text-decoration: line-through; | |
51 | background-color: #FF7F7F; } | |
52 | span.changed { background-color: #99ff99; } | |
53 | span.off { } | |
54 | </xsl:text> | |
55 | </style> | |
56 | </xsl:template> | |
57 | ||
58 | <xsl:template match="*[@revisionflag]"> | |
59 | <xsl:choose> | |
60 | <xsl:when test="local-name(.) = 'para' or local-name(.) = 'simpara' or local-name(.) = 'formalpara' or local-name(.) = 'section' or local-name(.) = 'sect1' or local-name(.) = 'sect2' or local-name(.) = 'sect3' or local-name(.) = 'sect4' or local-name(.) = 'sect5' or local-name(.) = 'chapter' or local-name(.) = 'preface' or local-name(.) = 'itemizedlist' or local-name(.) = 'varlistentry' or local-name(.) = 'glossary' or local-name(.) = 'bibliography' or local-name(.) = 'index' or local-name(.) = 'appendix'"> | |
61 | <div class="{@revisionflag}"> | |
62 | <xsl:apply-imports/> | |
63 | </div> | |
64 | </xsl:when> | |
65 | <xsl:when test="local-name(.) = 'phrase' or local-name(.) = 'ulink' or local-name(.) = 'link' or local-name(.) = 'filename' or local-name(.) = 'literal' or local-name(.) = 'member' or local-name(.) = 'glossterm' or local-name(.) = 'sgmltag' or local-name(.) = 'quote' or local-name(.) = 'emphasis' or local-name(.) = 'command' or local-name(.) = 'xref'"> | |
66 | <span class="{@revisionflag}"> | |
67 | <xsl:apply-imports/> | |
68 | </span> | |
69 | </xsl:when> | |
70 | <xsl:when test="local-name(.) = 'listitem' or local-name(.) = 'entry' or local-name(.) = 'title'"> | |
71 | <!-- nop; these are handled directly in the stylesheet --> | |
72 | <xsl:apply-imports/> | |
73 | </xsl:when> | |
74 | <xsl:otherwise> | |
75 | <xsl:message> | |
76 | <xsl:text>Revisionflag on unexpected element: </xsl:text> | |
77 | <xsl:value-of select="local-name(.)"/> | |
78 | <xsl:text> (Assuming block)</xsl:text> | |
79 | </xsl:message> | |
80 | <div class="{@revisionflag}"> | |
81 | <xsl:apply-imports/> | |
82 | </div> | |
83 | </xsl:otherwise> | |
84 | </xsl:choose> | |
85 | </xsl:template> | |
86 | ||
87 | ||
88 | <!-- The default uses short chapter titles in the TOC! I want them only for | |
89 | use in footer lines in printed output. So we have to modify this template. I | |
90 | changed "titleabbrev.markup" to "title.markup". --> | |
91 | ||
92 | <xsl:template name="toc.line"> | |
93 | <xsl:param name="toc-context" select="."/> | |
94 | <xsl:param name="depth" select="1"/> | |
95 | <xsl:param name="depth.from.context" select="8"/> | |
96 | ||
97 | <span> | |
98 | <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute> | |
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 | ||
106 | <xsl:variable name="label"> | |
107 | <xsl:apply-templates select="." mode="label.markup"/> | |
108 | </xsl:variable> | |
109 | <xsl:copy-of select="$label"/> | |
110 | <xsl:if test="$label != ''"> | |
111 | <xsl:value-of select="$autotoc.label.separator"/> | |
112 | </xsl:if> | |
113 | ||
114 | <xsl:apply-templates select="." mode="title.markup"/> | |
115 | </a> | |
116 | </span> | |
117 | </xsl:template> | |
118 | ||
119 | ||
120 | <!-- The default stylesheets generate both chapters and sections with <h2> | |
121 | headings in the HTML. The argument is that the HTML headings don't go deep | |
122 | enough to match the DocBook levels. But surely it would be better to stop them | |
123 | at the bottom end? Anyway, the Exim documents have only one level of section | |
124 | within chapters, and even if they went to two, it wouldn't exhaust HTML's | |
125 | capabilities. So I have copied the style stuff here, making a 1-character | |
126 | change from "+ 1" to "+ 2" in roughly the middle. --> | |
127 | ||
128 | <xsl:template name="section.heading"> | |
129 | <xsl:param name="section" select="."/> | |
130 | <xsl:param name="level" select="1"/> | |
131 | <xsl:param name="allow-anchors" select="1"/> | |
132 | <xsl:param name="title"/> | |
133 | <xsl:param name="class" select="'title'"/> | |
134 | ||
135 | <xsl:variable name="id"> | |
136 | <xsl:choose> | |
137 | <!-- if title is in an *info wrapper, get the grandparent --> | |
138 | <xsl:when test="contains(local-name(..), 'info')"> | |
139 | <xsl:call-template name="object.id"> | |
140 | <xsl:with-param name="object" select="../.."/> | |
141 | </xsl:call-template> | |
142 | </xsl:when> | |
143 | <xsl:otherwise> | |
144 | <xsl:call-template name="object.id"> | |
145 | <xsl:with-param name="object" select=".."/> | |
146 | </xsl:call-template> | |
147 | </xsl:otherwise> | |
148 | </xsl:choose> | |
149 | </xsl:variable> | |
150 | ||
151 | <!-- HTML H level is two higher than section level --> | |
152 | <xsl:variable name="hlevel" select="$level + 2"/> | |
153 | <xsl:element name="h{$hlevel}"> | |
154 | <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute> | |
155 | <xsl:if test="$css.decoration != '0'"> | |
156 | <xsl:if test="$hlevel<3"> | |
157 | <xsl:attribute name="style">clear: both</xsl:attribute> | |
158 | </xsl:if> | |
159 | </xsl:if> | |
160 | <xsl:if test="$allow-anchors != 0"> | |
161 | <xsl:call-template name="anchor"> | |
162 | <xsl:with-param name="node" select="$section"/> | |
163 | <xsl:with-param name="conditional" select="0"/> | |
164 | </xsl:call-template> | |
165 | </xsl:if> | |
166 | <xsl:copy-of select="$title"/> | |
167 | </xsl:element> | |
168 | </xsl:template> | |
169 | ||
170 | ||
171 | </xsl:stylesheet> |