[PATCH] Cross-version navigation in documentation

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-www <pgsql-www(at)postgresql(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Subject: [PATCH] Cross-version navigation in documentation
Date: 2012-05-27 18:06:03
Message-ID: CABRT9RCFpt35TdrrN0jsY3YfqMiiJOTTWYWpSQKYaEdcQZKugw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

Hi list,

It always bothers me that Google links to version-specific PostgreSQL
documentation pages, usually an obsolete version. This patch lets you
easily navigate to the version you want by adding a new line at the
top:

This page in other versions: 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 /
8.0 / 7.4 / 7.3 / 7.2 / devel

The same page in different versions is assumed to have the same file
name. No effort is done to track pages which have been
removed/added/split/renamed -- I think that would be lots of
complexity for little gain. For example, The 7.4 version contains 644
doc pages, and only 68 of those (~10%) aren't present in 9.2. In
actual relevant versions, the overlap is much greater.

I also noticed that the docs table isn't currently indexed at all.
docs/models.py now defines a new index/unique constraint, which
requires manual migration:
alter table docs add unique (file, version);

PS: Python projects have a nearly universal style of using 4-space
indents (PEP-0008). I understand that PostgreSQL itself uses tabs, but
maybe a change is warranted here, since Python is particularly picky
about indentation?

----
Attached are two patches:

0001-Allow-documentation-loading-without-tidy-Tidylib-for.patch
Just a simple fallback so docs can be imported without µTidylib --
which is not packaged for Arch Linux

0002-Add-basic-version-navigation-support-for-documentati.patch
Actual implementation of cross-version navigation

Also available from my github fork: https://github.com/intgr/pgweb

Regards,
Marti

Attachment Content-Type Size
0001-Allow-documentation-loading-without-tidy-Tidylib-for.patch application/octet-stream 1.4 KB
0002-Add-basic-version-navigation-support-for-documentati.patch application/octet-stream 5.4 KB

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Magnus Hagander 2012-05-27 18:40:57 Re: [PATCH] Cross-version navigation in documentation
Previous Message Magnus Hagander 2012-05-27 09:12:17 Re: Advantages page out of date