summaryrefslogtreecommitdiff
path: root/devel/xsl
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-09-22 22:06:51 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-09-22 22:06:51 -0500
commit6c515197f0792bace16a4b08679ba82f454d53f0 (patch)
tree5beb938012eadc567d2852e37eb69472c38da685 /devel/xsl
parent5ed47ef7ae6ed64d361e1c8945eacc59923467fc (diff)
downloadhorizon-6c515197f0792bace16a4b08679ba82f454d53f0.tar.gz
horizon-6c515197f0792bace16a4b08679ba82f454d53f0.tar.bz2
horizon-6c515197f0792bace16a4b08679ba82f454d53f0.tar.xz
horizon-6c515197f0792bace16a4b08679ba82f454d53f0.zip
Put build system in Git
Diffstat (limited to 'devel/xsl')
-rw-r--r--devel/xsl/LICENSE1
-rw-r--r--devel/xsl/permalinks.xsl26
-rw-r--r--devel/xsl/section.title.xsl55
3 files changed, 82 insertions, 0 deletions
diff --git a/devel/xsl/LICENSE b/devel/xsl/LICENSE
new file mode 100644
index 0000000..08339a9
--- /dev/null
+++ b/devel/xsl/LICENSE
@@ -0,0 +1 @@
+Taken from http://doccookbook.sourceforge.net/html/en/ which is licensed CC BY-NC-SA 3.0.
diff --git a/devel/xsl/permalinks.xsl b/devel/xsl/permalinks.xsl
new file mode 100644
index 0000000..f6a74fc
--- /dev/null
+++ b/devel/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>
diff --git a/devel/xsl/section.title.xsl b/devel/xsl/section.title.xsl
new file mode 100644
index 0000000..8edfb6e
--- /dev/null
+++ b/devel/xsl/section.title.xsl
@@ -0,0 +1,55 @@
+<!-- SPDX-Identifier: CC-BY-NC-SA-3.0 -->
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <xsl:template name="section.title">
+ <xsl:variable name="section"
+ select="(ancestor::section |
+ ancestor::simplesect|
+ ancestor::sect1|
+ ancestor::sect2|
+ ancestor::sect3|
+ ancestor::sect4|
+ ancestor::sect5)[last()]"/>
+
+ <xsl:variable name="renderas">
+ <xsl:choose>
+ <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
+ <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="level">
+ <xsl:choose>
+ <xsl:when test="$renderas != ''">
+ <xsl:value-of select="$renderas"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="section.level">
+ <xsl:with-param name="node" select="$section"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="section.heading">
+ <xsl:with-param name="section" select="$section"/>
+ <xsl:with-param name="level" select="$level"/>
+ <xsl:with-param name="title">
+ <xsl:apply-templates select="$section" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ <xsl:if test="$level = 1">
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$section"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+</xsl:stylesheet>