From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [GENERAL] Postgres 10 manual breaks links with anchors
Date: Thu, 26 Oct 2017 15:22:52 -0400
Message-ID: <117c1306-32fd-c82f-8d76-81c31a81ef88@2ndquadrant.com> (raw)
In-Reply-To: <os1mii$lpk$1@blaine.gmane.org>
References: <os1mii$lpk$1@blaine.gmane.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 10/16/17 03:19, Thomas Kellerer wrote:
> I don't know if this is intentional, but the Postgres 10 manual started to use lowercase IDs as anchors in the manual.
>
> So, if I have e.g.: the following URL open in my browser:
>
> https://www.postgresql.org/docs/current/static/sql-createindex.html#sql-createindex-concurrently
>
> I cannot simply switch to an older version by replacing "current" with e.g. "9.5" because in the 9.5 manual the anchor was all uppercase, and the URL would need to be:
>
> https://www.postgresql.org/docs/9.5/static/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY
>
> Is this intentional?
>
> This also makes "cleaning" up links in e.g. StackOverflow that point to outdated versions of the manual a bit more cumbersome.
Here is a patch that can be applied to PG 10 to put the upper case
anchors back.
The question perhaps is whether we want to maintain this patch
indefinitely, or whether a clean break is better.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:0001-doc-Convert-ids-to-upper-case-at-build-time.patch (text/plain, 1.5K) download
From 9ae0f3c465228a28c2fe50eb2a038e87ccc15b2d Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Thu, 26 Oct 2017 15:19:56 -0400
Subject: [PATCH] doc: Convert ids to upper case at build time
This makes the produced HTML anchors upper case, making it backward
compatible with the previous (9.6) build system.
---
doc/src/sgml/stylesheet-html-common.xsl | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/doc/src/sgml/stylesheet-html-common.xsl b/doc/src/sgml/stylesheet-html-common.xslindex 72fac1e806..9d0d10f776 100644--- a/doc/src/sgml/stylesheet-html-common.xsl+++ b/doc/src/sgml/stylesheet-html-common.xsl@@ -263,4 +263,29 @@ set toc,title
</xsl:if>
</xsl:template>
++<!-- upper case anchors for backward compatibility -->++<xsl:template name="object.id">+ <xsl:param name="object" select="."/>+ <xsl:choose>+ <xsl:when test="$object/@id">+ <xsl:value-of select="translate($object/@id, &lowercase;, &uppercase;)"/>+ </xsl:when>+ <xsl:when test="$object/@xml:id">+ <xsl:value-of select="$object/@xml:id"/>+ </xsl:when>+ <xsl:when test="$generate.consistent.ids != 0">+ <!-- Make $object the current node -->+ <xsl:for-each select="$object">+ <xsl:text>id-</xsl:text>+ <xsl:number level="multiple" count="*"/>+ </xsl:for-each>+ </xsl:when>+ <xsl:otherwise>+ <xsl:value-of select="generate-id($object)"/>+ </xsl:otherwise>+ </xsl:choose>+</xsl:template>+
</xsl:stylesheet>
--
2.14.3
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, spam_eater@gmx.net, pgsql-hackers@postgresql.org
Subject: Re: [GENERAL] Postgres 10 manual breaks links with anchors
In-Reply-To: <117c1306-32fd-c82f-8d76-81c31a81ef88@2ndquadrant.com>
References: <os1mii$lpk$1@blaine.gmane.org> <117c1306-32fd-c82f-8d76-81c31a81ef88@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox