summaryrefslogtreecommitdiff
path: root/xsl/permalinks.xsl
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-12-14 16:40:54 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-12-14 16:40:54 -0600
commit304c8ff0bc1eb43934ad794dbde589e11a2f3902 (patch)
tree356b7b99d6630efe3801289a519771fff3affeb3 /xsl/permalinks.xsl
parenteb188b3e7208d57931873d2ca61620ec92e81138 (diff)
downloaddocs-304c8ff0bc1eb43934ad794dbde589e11a2f3902.tar.gz
docs-304c8ff0bc1eb43934ad794dbde589e11a2f3902.tar.bz2
docs-304c8ff0bc1eb43934ad794dbde589e11a2f3902.tar.xz
docs-304c8ff0bc1eb43934ad794dbde589e11a2f3902.zip
XSL: add permalinks to every section header
Diffstat (limited to 'xsl/permalinks.xsl')
-rw-r--r--xsl/permalinks.xsl26
1 files changed, 26 insertions, 0 deletions
diff --git a/xsl/permalinks.xsl b/xsl/permalinks.xsl
new file mode 100644
index 0000000..f6a74fc
--- /dev/null
+++ b/xsl/permalinks.xsl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- SPDX-Identifier: CC-BY-NC-SA-3.0 -->
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="generate.permalink" select="1"/>
+ <xsl:param name="permalink.text">¶</xsl:param>
+
+ <xsl:template name="permalink">
+ <xsl:param name="node" select="."/>
+
+ <xsl:if test="$generate.permalink != '0'">
+ <span class="permalink">
+ <a alt="Permalink" title="Permalink">
+ <xsl:attribute name="href">
+ <xsl:call-template name="href.target">
+ <xsl:with-param name="object" select="$node"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:copy-of select="$permalink.text"/>
+ </a>
+ </span>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>