]> git.proxmox.com Git - systemd.git/blame - man/custom-html.xsl
Imported Upstream version 219
[systemd.git] / man / custom-html.xsl
CommitLineData
663996b3
MS
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 -->
5eef597e 27<xsl:template match="citerefentry[not(@project)]">
663996b3
MS
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
5eef597e
MP
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
e735f4d4
MP
63<xsl:template match="citerefentry[@project='mankier']">
64 <a>
65 <xsl:attribute name="href">
66 <xsl:text>https://www.mankier.com/</xsl:text>
67 <xsl:value-of select="manvolnum"/>
68 <xsl:text>/</xsl:text>
69 <xsl:value-of select="refentrytitle"/>
70 </xsl:attribute>
71 <xsl:call-template name="inline.charseq"/>
72 </a>
73</xsl:template>
74
5eef597e
MP
75<xsl:template match="citerefentry[@project='archlinux']">
76 <a>
77 <xsl:attribute name="href">
78 <xsl:text>https://www.archlinux.org/</xsl:text>
79 <xsl:value-of select="refentrytitle"/>
80 <xsl:text>/</xsl:text>
81 <xsl:value-of select="refentrytitle"/>
82 <xsl:text>.</xsl:text>
83 <xsl:value-of select="manvolnum"/>
84 <xsl:text>.html</xsl:text>
85 </xsl:attribute>
86 <xsl:call-template name="inline.charseq"/>
87 </a>
88</xsl:template>
89
90<xsl:template match="citerefentry[@project='gummiboot']">
91 <xsl:call-template name="inline.charseq"/>
92</xsl:template>
93
663996b3
MS
94<xsl:template match="refsect1/title|refsect1/info/title">
95 <!-- the ID is output in the block.object call for refsect1 -->
96 <h2>
97 <xsl:attribute name="id">
98 <xsl:call-template name="inline.charseq"/>
99 </xsl:attribute>
100 <xsl:apply-templates/>
101 <a>
102 <xsl:attribute name="class">
103 <xsl:text>headerlink</xsl:text>
104 </xsl:attribute>
105 <xsl:attribute name="title">
106 <xsl:text>Permalink to this headline</xsl:text>
107 </xsl:attribute>
108 <xsl:attribute name="href">
109 <xsl:text>#</xsl:text>
110 <xsl:call-template name="inline.charseq"/>
111 </xsl:attribute>
112 <xsl:text>¶</xsl:text>
113 </a>
114 </h2>
115</xsl:template>
116
117<xsl:template match="refsect2/title|refsect2/info/title">
118 <h3>
119 <xsl:attribute name="id">
120 <xsl:call-template name="inline.charseq"/>
121 </xsl:attribute>
122 <xsl:apply-templates/>
123 <a>
124 <xsl:attribute name="class">
125 <xsl:text>headerlink</xsl:text>
126 </xsl:attribute>
127 <xsl:attribute name="title">
128 <xsl:text>Permalink to this headline</xsl:text>
129 </xsl:attribute>
130 <xsl:attribute name="href">
131 <xsl:text>#</xsl:text>
132 <xsl:call-template name="inline.charseq"/>
133 </xsl:attribute>
134 <xsl:text>¶</xsl:text>
135 </a>
136 </h3>
137</xsl:template>
138
139<xsl:template match="varlistentry">
140 <dt>
141 <xsl:attribute name="id">
142 <xsl:call-template name="inline.charseq">
143 <xsl:with-param name="content">
144 <xsl:copy-of select="term[position()=1]" />
145 </xsl:with-param>
146 </xsl:call-template>
147 </xsl:attribute>
148 <xsl:apply-templates select="term"/>
149 <a>
150 <xsl:attribute name="class">
151 <xsl:text>headerlink</xsl:text>
152 </xsl:attribute>
153 <xsl:attribute name="title">
154 <xsl:text>Permalink to this term</xsl:text>
155 </xsl:attribute>
156 <xsl:attribute name="href">
157 <!-- <xsl:call-template name="href.target.uri" /> -->
158 <xsl:text>#</xsl:text>
159 <xsl:call-template name="inline.charseq">
160 <xsl:with-param name="content">
161 <xsl:copy-of select="term[position()=1]" />
162 </xsl:with-param>
163 </xsl:call-template>
164 </xsl:attribute>
165 <xsl:text>¶</xsl:text>
166 </a>
167 </dt>
168 <dd>
169 <xsl:apply-templates select="listitem"/>
170 </dd>
171</xsl:template>
172
173
174<!-- add Index link at top of page -->
175<xsl:template name="user.header.content">
176 <style>
177 a.headerlink {
178 color: #c60f0f;
179 font-size: 0.8em;
180 padding: 0 4px 0 4px;
181 text-decoration: none;
182 visibility: hidden;
183 }
184
185 a.headerlink:hover {
186 background-color: #c60f0f;
187 color: white;
188 }
189
190 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
191 visibility: visible;
192 }
193 </style>
194
195 <a>
196 <xsl:attribute name="href">
197 <xsl:text>index.html</xsl:text>
198 </xsl:attribute>
199 <xsl:text>Index </xsl:text>
200 </a>·
201 <a>
202 <xsl:attribute name="href">
203 <xsl:text>systemd.directives.html</xsl:text>
204 </xsl:attribute>
205 <xsl:text>Directives </xsl:text>
206 </a>·
207 <a>
208 <xsl:attribute name="href">
209 <xsl:text>../python-systemd/index.html</xsl:text>
210 </xsl:attribute>
211 <xsl:text>Python </xsl:text>
212 </a>·
213 <a>
214 <xsl:attribute name="href">
215 <xsl:text>../libudev/index.html</xsl:text>
216 </xsl:attribute>
217 <xsl:text>libudev </xsl:text>
218 </a>·
219 <a>
220 <xsl:attribute name="href">
221 <xsl:text>../libudev/index.html</xsl:text>
222 </xsl:attribute>
223 <xsl:text>gudev </xsl:text>
224 </a>
225
226 <span style="float:right">
227 <xsl:text>systemd </xsl:text>
228 <xsl:value-of select="$systemd.version"/>
229 </span>
230 <hr/>
231</xsl:template>
232
14228c0d
MB
233<xsl:template match="literal">
234 <xsl:text>"</xsl:text>
235 <xsl:call-template name="inline.monoseq"/>
236 <xsl:text>"</xsl:text>
237</xsl:template>
238
663996b3
MS
239<!-- Switch things to UTF-8, ISO-8859-1 is soo yesteryear -->
240<xsl:output method="html" encoding="UTF-8" indent="no"/>
241
242</xsl:stylesheet>