Skip to content

Commit

Permalink
Sort categories/pages on the whole name not just the first letter.
Browse files Browse the repository at this point in the history
Performing a sort only on the first letter doesn't alphabetise the
contents within a given letter section, however sorting on the whole
word will still produce an alphabetised list as a whole.
Refs #9664
  • Loading branch information
martyngigg committed Jun 16, 2014
1 parent 6e7c6d2 commit 993c7c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/docs/sphinxext/mantiddoc/directives/categories.py
Expand Up @@ -264,8 +264,8 @@ def create_category_pages(app):
context = {}
context["title"] = category.name
# sort subcategories & pages by first letter
context["subcategories"] = sorted(category.subcategories, key = lambda x: x.name[0])
context["pages"] = sorted(category.pages, key = lambda x: x.name[0])
context["subcategories"] = sorted(category.subcategories, key = lambda x: x.name)
context["pages"] = sorted(category.pages, key = lambda x: x.name)

outdir = CATEGORIES_DIR + "/"
yield (outdir + name, context, template)
Expand Down

0 comments on commit 993c7c2

Please sign in to comment.