custom-html.xsl revision d77c25b1164f55fe3f9b5ad00c47c0e01243ad53
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend This file is part of systemd.
7ec4d5cc4aa574e3191bc5a612e68fd8f25ab7earpluem Copyright 2011 Lennart Poettering
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend systemd is free software; you can redistribute it and/or modify it
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend under the terms of the GNU Lesser General Public License as published by
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend the Free Software Foundation; either version 2.1 of the License, or
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend (at your option) any later version.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend systemd is distributed in the hope that it will be useful, but
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes WITHOUT ANY WARRANTY; without even the implied warranty of
909ce17e2bd0faef7b1c294f2307f009793fd493nd MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend Lesser General Public License for more details.
42af92a661a06b3cebc88d585aad75064a309d51nd You should have received a copy of the GNU Lesser General Public License
367d146f245f3b1c9f77c18e6ec591b52e0b344cbnicholes along with systemd; If not, see <http://www.gnu.org/licenses/>.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend - The docbook stylesheet injects empty anchor tags into generated HTML, identified by an auto-generated ID.
43f6cc6aa3312619633538b8978619a48c0ce52eminfrin - Ask the docbook stylesheet to generate reproducible output when generating (these) ID values.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend - This makes the output of this stylesheet reproducible across identical invocations on the same input,
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend - which is an easy and significant win for achieving reproducible builds.
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend - It may be even better to strip the empty anchors from the document output in addition to turning on consistent IDs,
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend - for this stylesheet contains its own custom ID logic (for generating permalinks) already.
e8b603fa9ccf7b17b11b42df6d8916fd97c2331dnd<!-- translate man page references to links to html pages -->
d6ce05b6521a82cc93da69f7c2116c4a5bc54f8cjim <xsl:value-of select="refentrytitle"/><xsl:text>.html</xsl:text>
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend<xsl:template match="citerefentry[@project='man-pages'] | citerefentry[manvolnum='2'] | citerefentry[manvolnum='4']">
1e367a83311e5243e04d68857d007d04765a48f9chrisd <xsl:text>http://man7.org/linux/man-pages/man</xsl:text>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi<xsl:template match="citerefentry[@project='mankier']">
f195a136dcd90148b116fdae8ce95b41ba92b87eminfrin<xsl:template match="citerefentry[@project='archlinux']">
f73f2c2fae0ded6c8273c28d025ba8aa8136a0fend <xsl:text>https://www.freebsd.org/cgi/man.cgi?</xsl:text>
- 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)
- A simple top-to-bottom numbering scheme is implemented for nodes with the same ID value to derive unique ID values for HTML output.
- Conflicts are detected solely based on keyNode, templateID is not taken into account for that purpose.
<xsl:variable name="conflictSource" select="preceding::refsect1/title|preceding::refsect1/info/title|
preceding::varlistentry/term[1]"/>
<!-- special case conflictCount = 0 to preserve compatibility with URLs generated by previous versions of this XSL stylesheet where possible -->
- It helps reduce tedious repetition and groups all actual markup output (as opposed to URL/ID logic) in a single location.
<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' -->
- 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.
<!-- simple wrapper around permalink to avoid repeating common info for each level of subheading covered by the permalink logic (h2, h3) -->
- 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.
<!-- the ID is output in the block.object call for refsect1 -->
- 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.
a.headerlink:hover {
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {