diff options
author | Ulrich Müller <ulm@gentoo.org> | 2021-02-22 23:02:43 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2021-02-25 20:06:13 +0100 |
commit | ca88a7b371840409a3f3788da5365d968a55118e (patch) | |
tree | 431ea0a60f57c3e5fbc9f0b0714aba529c950476 /devbook.xsl | |
parent | devbook.xsl: Remove code duplication in section templates (diff) | |
download | devmanual-ca88a7b371840409a3f3788da5365d968a55118e.tar.gz devmanual-ca88a7b371840409a3f3788da5365d968a55118e.tar.bz2 devmanual-ca88a7b371840409a3f3788da5365d968a55118e.zip |
devbook.xsl, devmanual.css: Add permalinks to section headers
While we use empty fragments ("#") elsewhere for navigation within the
document (because they don't cause reloading of the page), we use an
empty href ("") for the chapter because it is meant to be copied as an
external link.
Closes: https://bugs.gentoo.org/772005
Suggested-by: Sam James <sam@gentoo.org>
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'devbook.xsl')
-rw-r--r-- | devbook.xsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/devbook.xsl b/devbook.xsl index ec02aa4..49dc0c3 100644 --- a/devbook.xsl +++ b/devbook.xsl @@ -24,7 +24,10 @@ </xsl:variable> <xsl:template match="chapter"> - <h1 class="first-header"><xsl:apply-templates select="title"/></h1> + <h1 class="first-header"> + <xsl:apply-templates select="title"/> + <a class="permalink" href=""><span class="fa fa-link"/></a> + </h1> <xsl:apply-templates select="*[not(self::title)]"/> </xsl:template> @@ -42,6 +45,7 @@ <xsl:element name="h{$level}"> <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute> <xsl:apply-templates select="title"/> + <a class="permalink" href="#{$anchor}"><span class="fa fa-link"/></a> </xsl:element> <xsl:apply-templates select="*[not(self::title)]"/> </div> |