{"action":"opened","issue":{"url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1213","labels_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1213/labels{/name}","comments_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1213/comments","events_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1213/events","html_url":"https://github.com/sphinx-doc/testing2/issues/1213","id":53295684,"number":1213,"title":"make links to duplicate index entries predicatable","user":{"login":"shimizukawa","id":151623,"avatar_url":"https://avatars.githubusercontent.com/u/151623?v=3","gravatar_id":"","url":"https://api.github.com/users/shimizukawa","html_url":"https://github.com/shimizukawa","followers_url":"https://api.github.com/users/shimizukawa/followers","following_url":"https://api.github.com/users/shimizukawa/following{/other_user}","gists_url":"https://api.github.com/users/shimizukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/shimizukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimizukawa/subscriptions","organizations_url":"https://api.github.com/users/shimizukawa/orgs","repos_url":"https://api.github.com/users/shimizukawa/repos","events_url":"https://api.github.com/users/shimizukawa/events{/privacy}","received_events_url":"https://api.github.com/users/shimizukawa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sphinx-doc/testing2/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/sphinx-doc/testing2/labels/environment","name":"environment","color":"FFFFFF"},{"url":"https://api.github.com/repos/sphinx-doc/testing2/labels/prio%3Alow","name":"prio:low","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-03T06:10:25Z","updated_at":"2015-01-03T06:10:25Z","closed_at":null,"body":"tldr: sort indexentries.iteritems to get predictable link order in document index\n\nI've constructed a set of documents where I have individual documents and an all-in-one document that includes each individual document.  For example:\n\n  a.rst\n  b.rst\n  c.rst\n  all.rst\n    include a, b, c\n  index.rst\n    toctree: a, b, c, all\n\nWhen creating a master index (genindex) I get 2 links for each index entry as expected - one that points to the individual document (a.rst or b.rst, for example) and one that points to the all-in-one document (all.rst).\n\nHowever, I find that sometimes the first link points to the individual document and other times the first link points to the all-in-one document.  \n\nMy choice would be to have the index generation be more stable and predictable. \n\nI've found that if I place all my individual documents in a sub-directory and then sort the indexentries in sphinx.environment.create_index I get a stable and predictable index ordering.\n\n<  for fn, entries in self.indexentries.iteritems():\n>  for fn, entries in sorted(self.indexentries.iteritems()):\n\n----------------------------------------\n- Bitbucket: https://bitbucket.org/birkenfeld/sphinx/issue/1213\n- Originally reported by: Anonymous\n- Originally created at: 2013-07-15T16:22:44.368\n"}}