chiark / gitweb /
test: add and improve hashmap tests
[elogind.git] / man / custom-html.xsl
1 <?xml version='1.0'?> <!--*-nxml-*-->
2
3 <!--
4   This file is part of systemd.
5
6   Copyright 2011 Lennart Poettering
7
8   systemd is free software; you can redistribute it and/or modify it
9   under the terms of the GNU Lesser General Public License as published by
10   the Free Software Foundation; either version 2.1 of the License, or
11   (at your option) any later version.
12
13   systemd is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   Lesser General Public License for more details.
17
18   You should have received a copy of the GNU Lesser General Public License
19   along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 -->
21
22 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
23
24 <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
25
26 <!-- translate man page references to links to html pages -->
27 <xsl:template match="citerefentry[not(@project)]">
28   <a>
29     <xsl:attribute name="href">
30       <xsl:value-of select="refentrytitle"/><xsl:text>.html</xsl:text>
31     </xsl:attribute>
32     <xsl:call-template name="inline.charseq"/>
33   </a>
34 </xsl:template>
35
36 <xsl:template match="citerefentry[@project='man-pages'] | citerefentry[manvolnum='2'] | citerefentry[manvolnum='4']">
37   <a>
38     <xsl:attribute name="href">
39       <xsl:text>http://man7.org/linux/man-pages/man</xsl:text>
40       <xsl:value-of select="manvolnum"/>
41       <xsl:text>/</xsl:text>
42       <xsl:value-of select="refentrytitle"/>
43       <xsl:text>.</xsl:text>
44       <xsl:value-of select="manvolnum"/>
45       <xsl:text>.html</xsl:text>
46     </xsl:attribute>
47     <xsl:call-template name="inline.charseq"/>
48   </a>
49 </xsl:template>
50
51 <xsl:template match="citerefentry[@project='die-net']">
52   <a>
53     <xsl:attribute name="href">
54       <xsl:text>http://linux.die.net/man/</xsl:text>
55       <xsl:value-of select="manvolnum"/>
56       <xsl:text>/</xsl:text>
57       <xsl:value-of select="refentrytitle"/>
58     </xsl:attribute>
59     <xsl:call-template name="inline.charseq"/>
60   </a>
61 </xsl:template>
62
63 <xsl:template match="citerefentry[@project='archlinux']">
64   <a>
65     <xsl:attribute name="href">
66       <xsl:text>https://www.archlinux.org/</xsl:text>
67       <xsl:value-of select="refentrytitle"/>
68       <xsl:text>/</xsl:text>
69       <xsl:value-of select="refentrytitle"/>
70       <xsl:text>.</xsl:text>
71       <xsl:value-of select="manvolnum"/>
72       <xsl:text>.html</xsl:text>
73     </xsl:attribute>
74     <xsl:call-template name="inline.charseq"/>
75   </a>
76 </xsl:template>
77
78 <xsl:template match="citerefentry[@project='gummiboot']">
79   <xsl:call-template name="inline.charseq"/>
80 </xsl:template>
81
82 <xsl:template match="refsect1/title|refsect1/info/title">
83   <!-- the ID is output in the block.object call for refsect1 -->
84   <h2>
85     <xsl:attribute name="id">
86       <xsl:call-template name="inline.charseq"/>
87     </xsl:attribute>
88     <xsl:apply-templates/>
89     <a>
90       <xsl:attribute name="class">
91         <xsl:text>headerlink</xsl:text>
92       </xsl:attribute>
93       <xsl:attribute name="title">
94         <xsl:text>Permalink to this headline</xsl:text>
95       </xsl:attribute>
96       <xsl:attribute name="href">
97         <xsl:text>#</xsl:text>
98         <xsl:call-template name="inline.charseq"/>
99       </xsl:attribute>
100       <xsl:text>¶</xsl:text>
101     </a>
102   </h2>
103 </xsl:template>
104
105 <xsl:template match="refsect2/title|refsect2/info/title">
106   <h3>
107     <xsl:attribute name="id">
108       <xsl:call-template name="inline.charseq"/>
109     </xsl:attribute>
110     <xsl:apply-templates/>
111     <a>
112       <xsl:attribute name="class">
113         <xsl:text>headerlink</xsl:text>
114       </xsl:attribute>
115       <xsl:attribute name="title">
116         <xsl:text>Permalink to this headline</xsl:text>
117       </xsl:attribute>
118       <xsl:attribute name="href">
119         <xsl:text>#</xsl:text>
120         <xsl:call-template name="inline.charseq"/>
121       </xsl:attribute>
122       <xsl:text>¶</xsl:text>
123     </a>
124   </h3>
125 </xsl:template>
126
127 <xsl:template match="varlistentry">
128   <dt>
129     <xsl:attribute name="id">
130       <xsl:call-template name="inline.charseq">
131         <xsl:with-param name="content">
132           <xsl:copy-of select="term[position()=1]" />
133         </xsl:with-param>
134       </xsl:call-template>
135     </xsl:attribute>
136     <xsl:apply-templates select="term"/>
137     <a>
138       <xsl:attribute name="class">
139         <xsl:text>headerlink</xsl:text>
140       </xsl:attribute>
141       <xsl:attribute name="title">
142         <xsl:text>Permalink to this term</xsl:text>
143       </xsl:attribute>
144       <xsl:attribute name="href">
145         <!--        <xsl:call-template name="href.target.uri" /> -->
146         <xsl:text>#</xsl:text>
147         <xsl:call-template name="inline.charseq">
148           <xsl:with-param name="content">
149             <xsl:copy-of select="term[position()=1]" />
150           </xsl:with-param>
151         </xsl:call-template>
152       </xsl:attribute>
153       <xsl:text>¶</xsl:text>
154     </a>
155   </dt>
156   <dd>
157     <xsl:apply-templates select="listitem"/>
158   </dd>
159 </xsl:template>
160
161
162 <!-- add Index link at top of page -->
163 <xsl:template name="user.header.content">
164   <style>
165     a.headerlink {
166       color: #c60f0f;
167       font-size: 0.8em;
168       padding: 0 4px 0 4px;
169       text-decoration: none;
170       visibility: hidden;
171     }
172
173     a.headerlink:hover {
174       background-color: #c60f0f;
175       color: white;
176     }
177
178     h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
179       visibility: visible;
180     }
181   </style>
182
183   <a>
184     <xsl:attribute name="href">
185       <xsl:text>index.html</xsl:text>
186     </xsl:attribute>
187     <xsl:text>Index </xsl:text>
188   </a>·
189   <a>
190     <xsl:attribute name="href">
191       <xsl:text>systemd.directives.html</xsl:text>
192     </xsl:attribute>
193     <xsl:text>Directives </xsl:text>
194   </a>·
195   <a>
196     <xsl:attribute name="href">
197       <xsl:text>../python-systemd/index.html</xsl:text>
198     </xsl:attribute>
199     <xsl:text>Python </xsl:text>
200   </a>·
201   <a>
202     <xsl:attribute name="href">
203       <xsl:text>../libudev/index.html</xsl:text>
204     </xsl:attribute>
205     <xsl:text>libudev </xsl:text>
206   </a>·
207   <a>
208     <xsl:attribute name="href">
209       <xsl:text>../libudev/index.html</xsl:text>
210     </xsl:attribute>
211     <xsl:text>gudev </xsl:text>
212   </a>
213
214   <span style="float:right">
215     <xsl:text>systemd </xsl:text>
216     <xsl:value-of select="$systemd.version"/>
217   </span>
218   <hr/>
219 </xsl:template>
220
221 <xsl:template match="literal">
222   <xsl:text>"</xsl:text>
223   <xsl:call-template name="inline.monoseq"/>
224   <xsl:text>"</xsl:text>
225 </xsl:template>
226
227 <!-- Switch things to UTF-8, ISO-8859-1 is soo yesteryear -->
228 <xsl:output method="html" encoding="UTF-8" indent="no"/>
229
230 </xsl:stylesheet>