summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2016-12-13 00:47:18 +0900
committershimizukawa <shimizukawa@gmail.com>2016-12-13 00:47:18 +0900
commit4054b0b3a554a0a08a39f5a6152a97c31f8ed13b (patch)
tree75f641ebf923fbdcf2e11f6f586dcbf2f1d68a68
parent5fc8d3db9160cf9dcbb5ed1034aec9302dbac0dd (diff)
downloadsphinx-git-4054b0b3a554a0a08a39f5a6152a97c31f8ed13b.tar.gz
Fix #3183: Randomized jump box order in generated index page.
-rw-r--r--CHANGES2
-rw-r--r--sphinx/environment/managers/indexentries.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 8e73f560a..750dda19f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -23,7 +23,7 @@ Bugs fixed
* #3228: ``build_sphinx`` command crashes when missing dependency
* #2469: Ignore updates of catalog files for gettext builder. Thanks to
Hiroshi Ohkubo.
-
+* #3183: Randomized jump box order in generated index page.
Release 1.5 (released Dec 5, 2016)
==================================
diff --git a/sphinx/environment/managers/indexentries.py b/sphinx/environment/managers/indexentries.py
index c35a161b4..d4e5f05bd 100644
--- a/sphinx/environment/managers/indexentries.py
+++ b/sphinx/environment/managers/indexentries.py
@@ -115,7 +115,11 @@ class IndexEntries(EnvironmentManager):
# sort the index entries; put all symbols at the front, even those
# following the letters in ASCII, this is where the chr(127) comes from
def keyfunc(entry, lcletters=string.ascii_lowercase + '_'):
- lckey = unicodedata.normalize('NFD', entry[0].lower())
+ key, (void, void, category_key) = entry
+ if category_key:
+ # using specified category key to sort
+ key = category_key
+ lckey = unicodedata.normalize('NFD', key.lower())
if lckey[0:1] in lcletters:
lckey = chr(127) + lckey
# ensure a determinstic order *within* letters by also sorting on