1 <!-- $Cambridge: exim/doc/doc-docbook/MyStyle-html.xsl,v 1.1 2005/06/16 10:32:31 ph10 Exp $ -->
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
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. -->
9 <xsl:import href="MyStyle.xsl"/>
11 <xsl:param name="shade.verbatim" select="1"></xsl:param>
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>
20 <!-- This is how you can make use of a CSS stylesheet, but at present I'm
24 <xsl:param name="html.stylesheet" select="'Myhtml.css'"/>
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. -->
33 <xsl:param name="navig.showtitles" select="'0'"/>
36 <!-- This allows for the setting of RevisionFlag on elements. -->
38 <xsl:param name="show.revisionflag" select="'1'"/>
40 <xsl:template name="system.head.content">
41 <style type="text/css">
43 div.added { background-color: #ffff99; }
44 div.deleted { text-decoration: line-through;
45 background-color: #FF7F7F; }
46 div.changed { background-color: #99ff99; }
49 span.added { background-color: #ffff99; }
50 span.deleted { text-decoration: line-through;
51 background-color: #FF7F7F; }
52 span.changed { background-color: #99ff99; }
58 <xsl:template match="*[@revisionflag]">
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}">
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}">
70 <xsl:when test="local-name(.) = 'listitem' or local-name(.) = 'entry' or local-name(.) = 'title'">
71 <!-- nop; these are handled directly in the stylesheet -->
76 <xsl:text>Revisionflag on unexpected element: </xsl:text>
77 <xsl:value-of select="local-name(.)"/>
78 <xsl:text> (Assuming block)</xsl:text>
80 <div class="{@revisionflag}">
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". -->
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"/>
98 <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
100 <xsl:attribute name="href">
101 <xsl:call-template name="href.target">
102 <xsl:with-param name="context" select="$toc-context"/>
106 <xsl:variable name="label">
107 <xsl:apply-templates select="." mode="label.markup"/>
109 <xsl:copy-of select="$label"/>
110 <xsl:if test="$label != ''">
111 <xsl:value-of select="$autotoc.label.separator"/>
114 <xsl:apply-templates select="." mode="title.markup"/>
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. -->
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'"/>
135 <xsl:variable name="id">
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="../.."/>
144 <xsl:call-template name="object.id">
145 <xsl:with-param name="object" select=".."/>
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>
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"/>
166 <xsl:copy-of select="$title"/>