Debian Codegraph @

src/docbkx/styles/reference-html-common.xsl

raw
1 <!--
2 ~ Copyright 2009-2013 Roland Huss
3 ~
4 ~ Licensed under the Apache License, Version 2.0 (the "License");
5 ~ you may not use this file except in compliance with the License.
6 ~ You may obtain a copy of the License at
7 ~
8 ~ http://www.apache.org/licenses/LICENSE-2.0
9 ~
10 ~ Unless required by applicable law or agreed to in writing, software
11 ~ distributed under the License is distributed on an "AS IS" BASIS,
12 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ~ See the License for the specific language governing permissions and
14 ~ limitations under the License.
15 -->
16 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17 xmlns:xslthl="http://xslthl.sf.net"
18 version="1.0">
19 <xsl:import href="urn:docbkx:stylesheet" />
20
21 <xsl:param name="use.extensions">1</xsl:param>
22 <xsl:param name="toc.section.depth">2</xsl:param>
23 <xsl:param name="section.autolabel">1</xsl:param>
24 <xsl:param name="section.label.includes.component.label">1</xsl:param>
25 <xsl:param name="css.decoration">0</xsl:param>
26 <xsl:param name="highlight.source" select="1"/>
27
28 <!-- Use custom style sheet content -->
29 <xsl:param name="html.stylesheet">DUMMY</xsl:param>
30 <xsl:template name="output.html.stylesheets">
31 <link href="css/base.css" rel="stylesheet" type="text/css"/>
32 <link href="css/style.css" rel="stylesheet" type="text/css"/>
33 </xsl:template>
34
35 <xsl:param name="generate.toc">
36 book toc,title,example
37 </xsl:param>
38
39 <xsl:param name="formal.title.placement">
40 figure before
41 example before
42 equation before
43 table before
44 procedure before
45 </xsl:param>
46
47 <xsl:template name="customXref">
48 <xsl:param name="target"/>
49 <xsl:param name="content">
50 <xsl:apply-templates select="$target" mode="object.title.markup"/>
51 </xsl:param>
52 <a>
53 <xsl:attribute name="href">
54 <xsl:call-template name="href.target">
55 <xsl:with-param name="object" select="$target"/>
56 </xsl:call-template>
57 </xsl:attribute>
58 <xsl:attribute name="title">
59 <xsl:apply-templates select="$target" mode="object.title.markup.textonly"/>
60 </xsl:attribute>
61 <xsl:value-of select="$content"/>
62 </a>
63 </xsl:template>
64
65 <!-- Overridden to remove standard body attributes -->
66 <xsl:template name="body.attributes">
67 </xsl:template>
68
69 <!-- Overridden to remove title attribute from structural divs -->
70 <xsl:template match="book|chapter|appendix|section|tip|note" mode="html.title.attribute">
71 </xsl:template>
72
73 <!-- ADMONITIONS -->
74
75 <!-- Overridden to remove style from admonitions -->
76 <xsl:param name="admon.style">
77 </xsl:param>
78
79 <xsl:template match="tip[@role='exampleLocation']" mode="class.value"><xsl:value-of select="@role"/></xsl:template>
80
81 <xsl:param name="admon.textlabel">0</xsl:param>
82
83 <!-- BOOK TITLEPAGE -->
84
85 <!-- Customise the contents of the book titlepage -->
86 <xsl:template name="book.titlepage">
87 <div class="titlepage">
88 <div class="title">
89 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/>
90 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/subtitle"/>
91 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/>
92 </div>
93 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/>
94 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/>
95 <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/>
96 </div>
97 </xsl:template>
98
99 <xsl:template match="releaseinfo" mode="titlepage.mode">
100 <h3 class='releaseinfo'>Version <xsl:value-of select="."/></h3>
101 </xsl:template>
102
103 <xsl:template match="sidebar">
104 <div class="sidebar-border">
105 <div>
106 <xsl:apply-templates select="." mode="class.attribute"/>
107 <xsl:call-template name="anchor"/>
108 <xsl:call-template name="formal.object.heading">
109 <xsl:with-param name="title">
110 <xsl:apply-templates select="." mode="title.markup">
111 <xsl:with-param name="allow-anchors" select="'1'"/>
112 </xsl:apply-templates>
113 </xsl:with-param>
114 </xsl:call-template>
115 <xsl:apply-templates/>
116 </div>
117 </div>
118 </xsl:template>
119
120 <!-- CHAPTER/APPENDIX TITLES -->
121
122 <!-- Use an <h1> instead of <h2> for chapter titles -->
123 <xsl:template name="component.title">
124 <h1>
125 <xsl:call-template name="anchor">
126 <xsl:with-param name="node" select=".."/>
127 <xsl:with-param name="conditional" select="0"/>
128 </xsl:call-template>
129 <xsl:apply-templates select=".." mode="object.title.markup"/>
130 </h1>
131 </xsl:template>
132
133 <!-- TABLES -->
134
135 <!-- Duplicated from docbook stylesheets, to fix problem where html table does not get a title -->
136 <xsl:template match="table">
137 <div class="table">
138 <xsl:if test="title">
139 <xsl:call-template name="formal.object.heading"/>
140 </xsl:if>
141 <div class="table-contents">
142 <table>
143 <xsl:copy-of select="@*[not(local-name()='id')]"/>
144 <xsl:attribute name="id">
145 <xsl:call-template name="object.id"/>
146 </xsl:attribute>
147 <xsl:call-template name="htmlTable"/>
148 </table>
149 </div>
150 </div>
151 </xsl:template>
152
153 <xsl:template match="title" mode="htmlTable">
154 </xsl:template>
155
156 <!-- CODE HIGHLIGHTING -->
157
158 <xsl:template match='xslthl:keyword' mode="xslthl">
159 <span class="hl-keyword"><xsl:apply-templates mode="xslthl"/></span>
160 </xsl:template>
161
162 <xsl:template match='xslthl:string' mode="xslthl">
163 <span class="hl-string"><xsl:apply-templates mode="xslthl"/></span>
164 </xsl:template>
165
166 <xsl:template match='xslthl:comment' mode="xslthl">
167 <span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span>
168 </xsl:template>
169
170 <xsl:template match='xslthl:number' mode="xslthl">
171 <span class="hl-number"><xsl:apply-templates mode="xslthl"/></span>
172 </xsl:template>
173
174 <xsl:template match='xslthl:annotation' mode="xslthl">
175 <span class="hl-annotation"><xsl:apply-templates mode="xslthl"/></span>
176 </xsl:template>
177
178 <xsl:template match='xslthl:doccomment' mode="xslthl">
179 <span class="hl-doccomment"><xsl:apply-templates mode="xslthl"/></span>
180 </xsl:template>
181
182 <xsl:template match='xslthl:tag' mode="xslthl">
183 <span class="hl-tag"><xsl:apply-templates mode="xslthl"/></span>
184 </xsl:template>
185
186 <xsl:template match='xslthl:attribute' mode="xslthl">
187 <span class="hl-attribute"><xsl:apply-templates mode="xslthl"/></span>
188 </xsl:template>
189
190 <xsl:template match='xslthl:value' mode="xslthl">
191 <span class="hl-value"><xsl:apply-templates mode="xslthl"/></span>
192 </xsl:template>
193
194 <xsl:template name="user.head.content">
195 <script data-cfasync="false" type="text/javascript">
196 var host = "jolokia.org";
197 if ((host == window.location.host) &amp;&amp; (window.location.protocol != "https:")) {
198 window.location.protocol = "https";
199 }
200 </script>
201 </xsl:template>
202 </xsl:stylesheet>