[docs] Add a version switcher to python docs site (issue 16331)

ezio.melotti at gmail.com ezio.melotti at gmail.com
Fri Oct 26 19:48:52 CEST 2012


http://bugs.python.org/review/16331/diff/6400/Doc/conf.py
File Doc/conf.py (right):

http://bugs.python.org/review/16331/diff/6400/Doc/conf.py#newcode72
Doc/conf.py:72: html_short_title = 'Documentation'
I would leave this unchanged, in order to have the right title when js
is not available.

http://bugs.python.org/review/16331/diff/6400/Doc/tools/sphinxext/layout.html
File Doc/tools/sphinxext/layout.html (right):

http://bugs.python.org/review/16331/diff/6400/Doc/tools/sphinxext/layout.html#newcode7
Doc/tools/sphinxext/layout.html:7: <span id="version_switcher">{{
release }}</span>
This should probably be wrapped in an {% if not embedded %}

http://bugs.python.org/review/16331/diff/6400/Doc/tools/sphinxext/static/version_switch.js
File Doc/tools/sphinxext/static/version_switch.js (right):

http://bugs.python.org/review/16331/diff/6400/Doc/tools/sphinxext/static/version_switch.js#newcode4
Doc/tools/sphinxext/static/version_switch.js:4: var all_versions =
['3.4', '3.3', '3.2', '3.1', '3.0',
I would drop 3.0 for sure, and possibly even 3.1 and >=2.4/5.
The 3.4 version should have some kind of marker to show that it's the
in-development version (something like 'dev (3.4)').

http://bugs.python.org/review/16331/diff/6400/Doc/tools/sphinxext/static/version_switch.js#newcode46
Doc/tools/sphinxext/static/version_switch.js:46: var url_re =
/\.org\/(py3k|release\/\d\.\d[\w\d\.]*|\d\.\d[\w\d\.]*)\//,
(py3k|release\/\d\.\d[\w\d\.]*|\d\.\d[\w\d\.]*) is equal to
(py3k|(?:release\/)?\d\.\d[\w\d\.]*)

http://bugs.python.org/review/16331/diff/6400/Doc/tools/sphinxext/static/version_switch.js#newcode46
Doc/tools/sphinxext/static/version_switch.js:46: var url_re =
/\.org\/(py3k|release\/\d\.\d[\w\d\.]*|\d\.\d[\w\d\.]*)\//,
It would be nice if this also worked on local copies of the doc, but
that depends on the dir layout.

http://bugs.python.org/review/16331/


More information about the docs mailing list