2011-12-19 23:25:52 +04:00
<?xml version='1.0'?> <!-- * - nxml - * -->
<!--
This file is part of systemd.
Copyright 2011 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
2012-04-12 02:20:58 +04:00
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
2011-12-19 23:25:52 +04:00
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2012-04-12 02:20:58 +04:00
Lesser General Public License for more details.
2011-12-19 23:25:52 +04:00
2012-04-12 02:20:58 +04:00
You should have received a copy of the GNU Lesser General Public License
2011-12-19 23:25:52 +04:00
along with systemd; If not, see <http: / / w w w . g n u . o r g / l i c e n s e s /> .
-->
<xsl:stylesheet xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" version= "1.0" >
<xsl:import href= "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl" />
2015-07-13 11:39:09 +03:00
<!--
- The docbook stylesheet injects empty anchor tags into generated HTML, identified by an auto-generated ID.
- Ask the docbook stylesheet to generate reproducible output when generating (these) ID values.
- This makes the output of this stylesheet reproducible across identical invocations on the same input,
- which is an easy and significant win for achieving reproducible builds.
-
- It may be even better to strip the empty anchors from the document output in addition to turning on consistent IDs,
- for this stylesheet contains its own custom ID logic (for generating permalinks) already.
-->
<xsl:param name= "generate.consistent.ids" select= "1" />
2011-12-19 23:25:52 +04:00
2012-07-18 01:04:48 +04:00
<!-- translate man page references to links to html pages -->
man: add a mapping for external manpages
It is annoying when we have dead links on fd.o.
Add project='man-pages|die-net|archlinux' to <citerefentry>-ies.
In generated html, add external links to
http://man7.org/linux/man-pages/man, http://linux.die.net/man/,
https://www.archlinux.org/.
By default, pages in sections 2 and 4 go to man7, since Michael
Kerrisk is the autorative source on kernel related stuff.
The rest of links goes to linux.die.net, because they have the
manpages.
Except for the pacman stuff, since it seems to be only available from
archlinux.org.
Poor gummiboot gets no link, because gummitboot(8) ain't to be found
on the net. According to common wisdom, that would mean that it does
not exist. But I have seen Kay using it, so I know it does, and
deserves to be found. Can somebody be nice and put it up somewhere?
2014-07-08 02:25:54 +04:00
<xsl:template match= "citerefentry[not(@project)]" >
2012-07-18 01:04:48 +04:00
<a >
<xsl:attribute name= "href" >
<xsl:value-of select= "refentrytitle" /> <xsl:text > .html</xsl:text>
</xsl:attribute>
<xsl:call-template name= "inline.charseq" />
</a>
</xsl:template>
man: add a mapping for external manpages
It is annoying when we have dead links on fd.o.
Add project='man-pages|die-net|archlinux' to <citerefentry>-ies.
In generated html, add external links to
http://man7.org/linux/man-pages/man, http://linux.die.net/man/,
https://www.archlinux.org/.
By default, pages in sections 2 and 4 go to man7, since Michael
Kerrisk is the autorative source on kernel related stuff.
The rest of links goes to linux.die.net, because they have the
manpages.
Except for the pacman stuff, since it seems to be only available from
archlinux.org.
Poor gummiboot gets no link, because gummitboot(8) ain't to be found
on the net. According to common wisdom, that would mean that it does
not exist. But I have seen Kay using it, so I know it does, and
deserves to be found. Can somebody be nice and put it up somewhere?
2014-07-08 02:25:54 +04:00
<xsl:template match= "citerefentry[@project='man-pages'] | citerefentry[manvolnum='2'] | citerefentry[manvolnum='4']" >
<a >
<xsl:attribute name= "href" >
<xsl:text > http://man7.org/linux/man-pages/man</xsl:text>
<xsl:value-of select= "manvolnum" />
<xsl:text > /</xsl:text>
<xsl:value-of select= "refentrytitle" />
<xsl:text > .</xsl:text>
<xsl:value-of select= "manvolnum" />
<xsl:text > .html</xsl:text>
</xsl:attribute>
<xsl:call-template name= "inline.charseq" />
</a>
</xsl:template>
<xsl:template match= "citerefentry[@project='die-net']" >
<a >
<xsl:attribute name= "href" >
<xsl:text > http://linux.die.net/man/</xsl:text>
<xsl:value-of select= "manvolnum" />
<xsl:text > /</xsl:text>
<xsl:value-of select= "refentrytitle" />
</xsl:attribute>
<xsl:call-template name= "inline.charseq" />
</a>
</xsl:template>
2015-02-02 00:05:56 +03:00
<xsl:template match= "citerefentry[@project='mankier']" >
<a >
<xsl:attribute name= "href" >
<xsl:text > https://www.mankier.com/</xsl:text>
<xsl:value-of select= "manvolnum" />
<xsl:text > /</xsl:text>
<xsl:value-of select= "refentrytitle" />
</xsl:attribute>
<xsl:call-template name= "inline.charseq" />
</a>
</xsl:template>
man: add a mapping for external manpages
It is annoying when we have dead links on fd.o.
Add project='man-pages|die-net|archlinux' to <citerefentry>-ies.
In generated html, add external links to
http://man7.org/linux/man-pages/man, http://linux.die.net/man/,
https://www.archlinux.org/.
By default, pages in sections 2 and 4 go to man7, since Michael
Kerrisk is the autorative source on kernel related stuff.
The rest of links goes to linux.die.net, because they have the
manpages.
Except for the pacman stuff, since it seems to be only available from
archlinux.org.
Poor gummiboot gets no link, because gummitboot(8) ain't to be found
on the net. According to common wisdom, that would mean that it does
not exist. But I have seen Kay using it, so I know it does, and
deserves to be found. Can somebody be nice and put it up somewhere?
2014-07-08 02:25:54 +04:00
<xsl:template match= "citerefentry[@project='archlinux']" >
<a >
<xsl:attribute name= "href" >
<xsl:text > https://www.archlinux.org/</xsl:text>
<xsl:value-of select= "refentrytitle" />
<xsl:text > /</xsl:text>
<xsl:value-of select= "refentrytitle" />
<xsl:text > .</xsl:text>
<xsl:value-of select= "manvolnum" />
<xsl:text > .html</xsl:text>
</xsl:attribute>
<xsl:call-template name= "inline.charseq" />
</a>
</xsl:template>
2015-03-14 05:23:24 +03:00
<xsl:template match= "citerefentry[@project='freebsd']" >
<a >
<xsl:attribute name= "href" >
<xsl:text > https://www.freebsd.org/cgi/man.cgi?</xsl:text>
<xsl:value-of select= "refentrytitle" />
<xsl:text > (</xsl:text>
<xsl:value-of select= "manvolnum" />
<xsl:text > )</xsl:text>
</xsl:attribute>
<xsl:call-template name= "inline.charseq" />
</a>
</xsl:template>
2015-03-14 05:24:30 +03:00
<xsl:template match= "citerefentry[@project='dbus']" >
<a >
<xsl:attribute name= "href" >
<xsl:text > http://dbus.freedesktop.org/doc/</xsl:text>
<xsl:value-of select= "refentrytitle" />
<xsl:text > .</xsl:text>
<xsl:value-of select= "manvolnum" />
<xsl:text > .html</xsl:text>
</xsl:attribute>
<xsl:call-template name= "inline.charseq" />
</a>
</xsl:template>
2015-07-12 04:07:24 +03:00
<!--
- helper template to do conflict resolution between various headings with the same inferred ID attribute/tag from the headerlink template
- this conflict resolution is necessary to prevent malformed HTML ouput (multiple id attributes with the same value)
- and it fixes xsltproc warnings during compilation of HTML man pages
-
- A simple top-to-bottom numbering scheme is implemented for nodes with the same ID value to derive unique ID values for HTML output.
- It uses two parameters:
templateID the proposed ID string to use which must be checked for conflicts
keyNode the context node which 'produced' the given templateID.
-
- Conflicts are detected solely based on keyNode, templateID is not taken into account for that purpose.
-->
<xsl:template name= "generateID" >
<!-- node which generatedID needs to assume as the 'source' of the ID -->
<xsl:param name= "keyNode" />
<!-- suggested value for generatedID output, a contextually meaningful ID string -->
<xsl:param name= "templateID" />
<xsl:variable name= "conflictSource" select= "preceding::refsect1/title|preceding::refsect1/info/title|
preceding::refsect2/title|preceding::refsect2/info/title|
preceding::varlistentry/term[1]"/>
<xsl:variable name= "conflictCount" select= "count($conflictSource[. = $keyNode])" />
<xsl:choose >
<!-- special case conflictCount = 0 to preserve compatibility with URLs generated by previous versions of this XSL stylesheet where possible -->
<xsl:when test= "$conflictCount = 0" >
<xsl:value-of select= "$templateID" />
</xsl:when>
<xsl:otherwise >
<xsl:value-of select= "concat($templateID, $conflictCount)" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
- a helper template to abstract over the structure of generated subheading + permalink HTML output
- It helps reduce tedious repetition and groups all actual markup output (as opposed to URL/ID logic) in a single location.
-->
<xsl:template name= "permalink" >
<xsl:param name= "nodeType" /> <!-- local name of the element node to generate, e.g. 'h2' for <h2></h2> -->
<xsl:param name= "nodeContent" /> <!-- nodeset to apply further templates to obtain the content of the subheading/term -->
<xsl:param name= "linkTitle" /> <!-- value for title attribute of generated permalink, e.g. 'this is a permalink' -->
<!-- parameters passed to generateID template, otherwise unused. -->
<xsl:param name= "keyNode" />
<xsl:param name= "templateID" />
<!--
- If stable URLs with fragment markers (references to the ID) turn out not to be important:
- generatedID could simply take the value of generate-id(), and various other helper templates may be dropped entirely.
- Alternatively if xsltproc is patched to generate reproducible generate-id() output the same simplifications can be
- applied at the cost of breaking compatibility with URLs generated from output of previous versions of this stylesheet.
-->
<xsl:variable name= "generatedID" >
<xsl:call-template name= "generateID" >
<xsl:with-param name= "keyNode" select= "$keyNode" />
<xsl:with-param name= "templateID" select= "$templateID" />
</xsl:call-template>
</xsl:variable>
<xsl:element name= "{$nodeType}" >
2013-05-04 04:25:57 +04:00
<xsl:attribute name= "id" >
2015-07-12 04:07:24 +03:00
<xsl:value-of select= "$generatedID" />
2013-05-04 04:25:57 +04:00
</xsl:attribute>
2015-07-12 04:07:24 +03:00
<xsl:apply-templates select= "$nodeContent" />
<a class= "headerlink" title= "{$linkTitle}" href= "#{$generatedID}" > ¶</a>
</xsl:element>
2013-05-04 04:25:57 +04:00
</xsl:template>
2015-07-12 04:07:24 +03:00
<!-- simple wrapper around permalink to avoid repeating common info for each level of subheading covered by the permalink logic (h2, h3) -->
<xsl:template name= "headerlink" >
<xsl:param name= "nodeType" />
<xsl:call-template name= "permalink" >
<xsl:with-param name= "nodeType" select= "$nodeType" />
<xsl:with-param name= "linkTitle" select= "'Permalink to this headline'" />
<xsl:with-param name= "nodeContent" select= "node()" />
<xsl:with-param name= "keyNode" select= "." />
<!--
- To retain compatibility with IDs generated by previous versions of the template, inline.charseq must be called.
- The purpose of that template is to generate markup (according to docbook documentation its purpose is to mark/format something as plain text).
- The only reason to call this template is to get the auto-generated text such as brackets ([]) before flattening it.
-->
<xsl:with-param name= "templateID" >
2013-05-07 04:00:16 +04:00
<xsl:call-template name= "inline.charseq" />
2015-07-12 04:07:24 +03:00
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match= "refsect1/title|refsect1/info/title" >
<!-- the ID is output in the block.object call for refsect1 -->
<xsl:call-template name= "headerlink" >
<xsl:with-param name= "nodeType" select= "'h2'" />
</xsl:call-template>
</xsl:template>
<xsl:template match= "refsect2/title|refsect2/info/title" >
<xsl:call-template name= "headerlink" >
<xsl:with-param name= "nodeType" select= "'h3'" />
</xsl:call-template>
2013-05-07 04:00:16 +04:00
</xsl:template>
2013-05-04 04:25:57 +04:00
<xsl:template match= "varlistentry" >
2015-07-12 04:07:24 +03:00
<xsl:call-template name= "permalink" >
<xsl:with-param name= "nodeType" select= "'dt'" />
<xsl:with-param name= "linkTitle" select= "'Permalink to this term'" />
<xsl:with-param name= "nodeContent" select= "term" />
<xsl:with-param name= "keyNode" select= "term[1]" />
<!--
- To retain compatibility with IDs generated by previous versions of the template, inline.charseq must be called.
- The purpose of that template is to generate markup (according to docbook documentation its purpose is to mark/format something as plain text).
- The only reason to call this template is to get the auto-generated text such as brackets ([]) before flattening it.
-->
<xsl:with-param name= "templateID" >
2013-05-04 04:25:57 +04:00
<xsl:call-template name= "inline.charseq" >
2015-07-12 04:07:24 +03:00
<xsl:with-param name= "content" select= "term[1]" />
2013-05-04 04:25:57 +04:00
</xsl:call-template>
2015-07-12 04:07:24 +03:00
</xsl:with-param>
</xsl:call-template>
2013-05-04 04:25:57 +04:00
<dd >
<xsl:apply-templates select= "listitem" />
</dd>
</xsl:template>
2012-07-18 01:04:48 +04:00
<!-- add Index link at top of page -->
<xsl:template name= "user.header.content" >
2013-05-04 04:25:57 +04:00
<style >
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style>
2012-07-18 01:04:48 +04:00
<a >
<xsl:attribute name= "href" >
<xsl:text > index.html</xsl:text>
</xsl:attribute>
<xsl:text > Index </xsl:text>
2013-03-07 22:13:44 +04:00
</a> ·
<a >
<xsl:attribute name= "href" >
<xsl:text > systemd.directives.html</xsl:text>
</xsl:attribute>
<xsl:text > Directives </xsl:text>
2015-06-22 20:54:52 +03:00
</a>
2013-03-13 07:57:09 +04:00
<span style= "float:right" >
<xsl:text > systemd </xsl:text>
<xsl:value-of select= "$systemd.version" />
</span>
2012-07-18 01:04:48 +04:00
<hr />
</xsl:template>
2013-06-26 16:03:53 +04:00
<xsl:template match= "literal" >
<xsl:text > "</xsl:text>
<xsl:call-template name= "inline.monoseq" />
<xsl:text > "</xsl:text>
</xsl:template>
2011-12-19 23:25:52 +04:00
<!-- Switch things to UTF - 8, ISO - 8859 - 1 is soo yesteryear -->
<xsl:output method= "html" encoding= "UTF-8" indent= "no" />
</xsl:stylesheet>