Mercurial > mplayer.hg
annotate DOCS/xml/xsl/ldp-html-common.xsl @ 30406:36c0fd3c17c4
Stopping maintainership for -vo (x)mga
author | attila |
---|---|
date | Wed, 27 Jan 2010 22:22:50 +0000 |
parents | 0f1b5b68af32 |
children | 0ad2da052b2e |
rev | line source |
---|---|
9675 | 1 <?xml version='1.0'?> |
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
3 version='1.0' | |
4 xmlns="http://www.w3.org/TR/xhtml1/transitional" | |
5 exclude-result-prefixes="#default" | |
6 > | |
7 | |
8 <!-- $Id --> | |
9 | |
10 <!-- Experimental stylesheet by Dan York | |
11 This is an attempt to replicate the customizations done in ldp.dsl | |
12 Each customization in ldp.dsl is listed in the order in which it | |
13 appears (in ldp.dsl) with the corresponding XSLT template or setting | |
14 below it. Where there is no XSLT code below an item, that particular | |
15 customization of ldp.dsl is not yet supported here. Some additional | |
16 options and features have been added and are noted as not being in | |
17 ldp.dsl. The work on this stylesheet began 5 Jul 2001. --> | |
18 | |
19 <!-- Note that this file, 'ldp-html-common.xsl', is NOT intended to be | |
20 called directly. Instead, you should call either of two stylesheets: | |
21 'ldp-html.xsl' or 'ldp-html-chunk.xsl'. The former generates a SINGLE | |
22 HTML file, while the latter performs "chunking" to generate MULTIPLE | |
23 HTML files. Both of those files import the appropriate Norman Walsh | |
24 stylesheet and then import this customization layer. --> | |
25 | |
26 <!-- NOT IN LDP.DSL - This stylesheet supports the additional use of the | |
27 "role" and "condition" attributes to the <author> tag. The XSLT template | |
28 is listed later in the stylesheet, but the text lables are listed | |
29 here in order to make localization of the stylesheet easier. Note | |
30 that spaces *are* significant in the value, so you should have a | |
31 space after the colon. --> | |
32 | |
33 <xsl:variable name="maintainerlabel">Maintainer: </xsl:variable> | |
34 <xsl:variable name="authorlabel">Author: </xsl:variable> | |
35 | |
36 | |
37 <!-- NOT IN LDP.DSL | |
38 Creates header content in all generated HTML files --> | |
39 | |
40 <xsl:template name="user.head.content"> | |
41 <xsl:param name="node" select="."/> | |
42 <meta name="generator" content="Experimental LDP.XSL $Revision$"/> | |
43 <xsl:text> | |
44 </xsl:text> | |
45 <xsl:comment> Generated by LDP XSLT customization layer | |
46 based on Norman Walsh's DocBook XSL stylesheets. | |
47 More information at http://www.linuxdoc.org/ </xsl:comment> | |
48 <xsl:text> | |
49 </xsl:text> | |
50 | |
51 </xsl:template> | |
52 | |
53 <!-- declare-characteristic preserve-sdata? | |
54 No longer appears necessary as it is a JadeTex issue. --> | |
55 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
56 <!-- generate-legalnotice-link? |
9675 | 57 Not currently supported in Norm's XSL stylesheets. Logged |
58 at SourceForge as a bug. --> | |
59 | |
60 <!-- Should graphics be used for admonitions (notes, warnings)? 0 or 1 --> | |
61 <xsl:param name="admon.graphics" select="0"/> | |
62 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
63 <!-- If using admon graphics (1 above), what is path to graphics? |
9675 | 64 Should be the path relative to your document and MUST end with |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
65 a trailing slash. Also, this parameter needs to be on a |
9675 | 66 single line. --> |
67 <xsl:param name="admon.graphics.path">images/</xsl:param> | |
68 | |
69 | |
70 <!-- Make funcsynopsis look pretty --> | |
71 <xsl:param name="funcsynopsis.decoration" select="1" doc:type="boolean"/> | |
72 | |
73 <!-- Extension for HTML files --> | |
74 <xsl:param name="html.ext" select="'.html'"/> | |
75 | |
76 <!-- Generate TOCs for book, article, part --> | |
77 <xsl:param name="generate.book.toc" select="1" doc:type="boolean"/> | |
78 <xsl:param name="generate.article.toc" select="1" doc:type="boolean"/> | |
79 <xsl:param name="generate.part.toc" select="1" doc:type="boolean"/> | |
80 | |
81 <!-- generate-book-titlepage --> | |
82 | |
83 <!-- generate-article-titlepage --> | |
84 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
85 <!-- Equivalent to chunk-skip-first-element-list - forces TOC on separate page |
9675 | 86 If 0, first sect is on page for chapter or article --> |
87 <xsl:param name="chunk.first.sections" select="'1'"/> | |
88 | |
89 | |
90 <!-- NOT IN LDP.DSL --> | |
91 <!-- Create chunks for top-level sections. If 0, chunks will only be | |
92 created for chapters/appendixes, and NOT for sectx elements --> | |
93 <xsl:param name="chunk.sections" select="'1'"/> | |
94 | |
95 <!-- list-element-list - NO LONGER NEEDED - bug fix --> | |
96 | |
97 <!-- Filename for the root chunk --> | |
98 <xsl:param name="root.filename" select="'index'"/> | |
99 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
100 <!-- shade-verbatim |
9675 | 101 I have created a function below that shades the verbatim sections. |
102 logic would need to be added to check if this is set. | |
103 Norm has added parameters to his 1.44 stylesheets that support | |
104 shading verbatim sections. However, it looks like it requires | |
105 an attribute to a table to have verbatim shading. Needs to be | |
106 explored further. --> | |
107 | |
108 <!-- When chunking, use id attribute as filename? 0 or 1 --> | |
109 <xsl:param name="use.id.as.filename" select="1"/> | |
110 | |
111 <!-- graphic-extensions - NO LONGER NEEDED?? --> | |
112 | |
113 <!-- default graphic filename extension --> | |
114 <xsl:param name="graphic.default.extension" select="'.gif'" doc:type="string"/> | |
115 | |
116 <!-- Should chapters be labeled? 0 or 1 --> | |
117 <xsl:param name="chapter.autolabel" select="1"/> | |
118 | |
119 <!-- Should sections be labeled? 0 or 1 --> | |
120 <xsl:param name="section.autolabel" select="1"/> | |
121 | |
122 <!-- Related to section labels, should those labels include the chapter | |
123 number in them (i.e., 1.1, 1.2, 1.3, 1.4 )--> | |
124 <xsl:param name="section.label.includes.component.label" select="1" doc:type="boolean"/> | |
125 | |
126 <!-- To what depth (in sections) should the TOC go? --> | |
127 <xsl:param name="toc.section.depth" select="2"/> | |
128 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
129 <!-- Custom 'emphasis' template to allow 'role="strong"' to |
9675 | 130 also produce a bold item. --> |
131 <xsl:template match="emphasis"> | |
132 <xsl:choose> | |
133 <xsl:when test="(@role='strong') or (@role='bold')"> | |
134 <xsl:call-template name="inline.boldseq"/> | |
135 </xsl:when> | |
136 <xsl:otherwise> | |
137 <xsl:call-template name="inline.italicseq"/> | |
138 </xsl:otherwise> | |
139 </xsl:choose> | |
140 </xsl:template> | |
141 | |
142 <!-- book-titlepage-recto-elements | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
143 article-titlepage-recto-elements |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
144 article-titlepage-recto-mode |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
145 article-title |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
146 |
9675 | 147 - Customizing these elements (for instance, to list what is on the |
148 title page) involves writing a layer for html/titlepage.templates.xml and the | |
149 other files html/titlepage.xsl and html/titlepage.templates.xsl - Norm | |
150 is doing something funky here and I haven't fully figured it out. --> | |
151 | |
152 <!-- The remainder of ldp.dsl deals with changing the foreground and | |
153 background colors of verbatim elements although in reading through the | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
9675
diff
changeset
|
154 DSSSL it doesn't look like it actually changed the foreground colors. |
9675 | 155 The changing of the background shading can be done at two locations |
156 (one numbered, one not) in the template below. --> | |
157 | |
158 <!-- Custom template for programlisting, screen and synopsis to generate a gray | |
159 background to the item. --> | |
160 <xsl:template match="programlisting|screen|synopsis"> | |
161 <xsl:param name="suppress-numbers" select="'0'"/> | |
162 <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> | |
163 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> | |
164 | |
165 <xsl:if test="@id"> | |
166 <a href="{$id}"/> | |
167 </xsl:if> | |
168 | |
169 <xsl:choose> | |
170 <xsl:when test="$suppress-numbers = '0' | |
171 and @linenumbering = 'numbered' | |
172 and $use.extensions != '0' | |
173 and $linenumbering.extension != '0'"> | |
174 <xsl:variable name="rtf"> | |
175 <xsl:apply-templates/> | |
176 </xsl:variable> | |
177 <!-- Change the color bacground color in the line below. --> | |
178 <table border="0" bgcolor="#E0E0E0" width="90%"> | |
179 <tr><td> | |
180 <pre class="{name(.)}"> | |
181 <xsl:call-template name="number.rtf.lines"> | |
182 <xsl:with-param name="rtf" select="$rtf"/> | |
183 </xsl:call-template> | |
184 </pre> | |
185 </td></tr></table> | |
186 </xsl:when> | |
187 <xsl:otherwise> | |
188 <!-- Change the color bacground color in the line below. --> | |
189 <table border="0" bgcolor="#E0E0E0" width="90%"> | |
190 <tr><td> | |
191 <pre class="{name(.)}"> | |
192 <xsl:apply-templates/> | |
193 </pre> | |
194 </td></tr></table> | |
195 </xsl:otherwise> | |
196 </xsl:choose> | |
197 </xsl:template> | |
198 | |
199 <!-- NOT IN LDP.DSL. Custom template to allow Maintainer to be a role in | |
200 the Author element. It also checks for a "condition" attribute | |
201 to the <author> element. If it finds the condition attribute, it | |
202 copies VERBATIM the value of the attribute to be in front of the | |
203 word Author or Maintainer. This is done to allow maximum flexibility. | |
204 Note that an <xsl:text> element was necessary to put the space | |
205 between the condition and the word Author or Maintainer. --> | |
206 | |
207 <xsl:template match="author" mode="titlepage.mode"> | |
208 <h3 class="{name(.)}"> | |
209 <!-- If there is a condition attribute, print it VERBATIM first --> | |
210 <xsl:if test="@condition"><i><xsl:value-of select="@condition"/></i> | |
211 <xsl:text> </xsl:text></xsl:if> | |
212 <!-- Test to see if there is a role. If maintainer, print that. If not, | |
213 assume it is an author. --> | |
214 <xsl:choose> | |
215 <xsl:when test="@role='maintainer'"> | |
216 <i><xsl:value-of select="$maintainerlabel"/></i> | |
217 </xsl:when> | |
218 <xsl:otherwise> | |
219 <i><xsl:value-of select="$authorlabel"/></i> | |
220 </xsl:otherwise> | |
221 </xsl:choose> | |
222 <xsl:call-template name="person.name"/> | |
223 </h3> | |
224 <xsl:apply-templates mode="titlepage.mode" select="./contrib"/> | |
225 <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/> | |
226 </xsl:template> | |
227 | |
228 | |
229 </xsl:stylesheet> |