Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:20
erlang
0246-erl_docgen-Use-name-based-anchors-where-po...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0246-erl_docgen-Use-name-based-anchors-where-possible.patch of Package erlang
From 70b94d93a425873d643b042d131603fea08e4ab3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson <lukas@erlang.org> Date: Mon, 9 Apr 2018 15:08:28 +0200 Subject: [PATCH 6/8] erl_docgen: Use name based anchors where possible We don't want to use generate-id as it varies across builds so it becomes impossible to link permanently to specific sections. --- lib/erl_docgen/priv/xsl/db_html.xsl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl index d92241277d..b6ebcc0c67 100644 --- a/lib/erl_docgen/priv/xsl/db_html.xsl +++ b/lib/erl_docgen/priv/xsl/db_html.xsl @@ -67,6 +67,11 @@ <func:result select="$result"/> </func:function> + <func:function name="erl:to-link"> + <xsl:param name="text"/> + <func:result select="translate(erl:lower-case($text),': /()" ','-------')"/> + </func:function> + <!-- Used from template menu.funcs to sort a module's functions for the lefthand index list, from the module's .xml file. Returns a value on which to sort the entity in question (a <name> element). @@ -951,7 +956,6 @@ <xsl:call-template name="marker-before-title"/> </xsl:for-each> <xsl:call-template name="title_link"> - <xsl:with-param name="link" select="generate-id(title)"/> <xsl:with-param name="title"> <xsl:value-of select="$chapnum"/>.<xsl:number/>  <xsl:value-of select="title"/> @@ -1397,7 +1401,7 @@ <xsl:param name="chapter_file"/> <xsl:for-each select="$entries"> <li title="{title}"> - <a href="{$chapter_file}.html#{generate-id(title)}"> + <a href="{$chapter_file}.html#{erl:to-link(title)}"> <xsl:value-of select="title"/> </a> </li> @@ -2202,14 +2206,14 @@ <h3> <xsl:call-template name="title_link"> <xsl:with-param name="title" select="$title"/> - <xsl:with-param name="link" select="translate(erl:lower-case($title),' ','-')"/> + <xsl:with-param name="link" select="erl:to-link($title)"/> </xsl:call-template> </h3> </xsl:template> <xsl:template name="title_link"> <xsl:param name="title"/> - <xsl:param name="link" select="generate-id(title)"/> + <xsl:param name="link" select="erl:to-link(title)"/> <xsl:param name="ghlink" select="ancestor-or-self::*[@ghlink][position() = 1]/@ghlink"/> <xsl:variable name="id" select="concat(concat($link,'-'), generate-id(.))"/> <span onMouseOver="document.getElementById('ghlink-{$id}').style.visibility = 'visible';" -- 2.16.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor