[PATCH] Cross-version navigation in documentation - Mailing list pgsql-www

From Marti Raudsepp
Subject [PATCH] Cross-version navigation in documentation
Date
Msg-id CABRT9RCFpt35TdrrN0jsY3YfqMiiJOTTWYWpSQKYaEdcQZKugw@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Cross-version navigation in documentation
List 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

pgsql-www by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Advantages page out of date
Next
From: Magnus Hagander
Date:
Subject: Re: [PATCH] Cross-version navigation in documentation