#1207 closed defect (wontfix)
Doesn't appear to sort alphabetically, at least in this particular use case?
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | HierWikiPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
While attempting to use the SubWiki macro, it seems to put the entries in an order that doesn't make any sense to me. I expected them to be in alphabet order.
The macro I used was:
[[SubWiki(UserManual/Vol1/,2)]]
This resulted in (rendered):
UserManual/Vol1/Sec1
IntroductionUserManual/Vol1/Sec4
Menu FunctionsUserManual/Vol1/Sec5
Jzz Tools OverviewUserManual/Vol1/Sec2
Jzz OverviewUserManual/Vol1/Sec3
Jzz Plan View Display
The order I would expect is Sec1, Sec2, Sec3, Sec4, and then Sec5. If instead it sorted by the title of the wiki pages, I would have expected it to be "Introduction", "Jzz Overview", "Jzz Plan View Display", "JZZ Tools Overview", and finally "Menu Functions".
Am I doing something wrong? I have tried grabbing the latest version from trac-hacks and it did not change the behavior. Thanks for any help!!
Attachments (0)
Change History (9)
comment:1 Changed 17 years ago by
Severity: | normal → major |
---|
comment:3 follow-up: 4 Changed 17 years ago by
Currently pages are added to the good_pages
-array with the pagename as key and the title as value. then the array is sorted by keys.
I'm new to python but MAYBE it will work if you replace in macros/subwiki.py
good_pages.append((p, title))
with
good_pages.append((title, p))
put
good_pages.sort()
before
return html.UL(
and replace
) for p,t in good_pages
wit
) for t,p in good_pages
I'm currently not able to test this because the only trac I have access to is a live system ;)
comment:4 follow-up: 5 Changed 17 years ago by
Replying to peter.koerner@tmp.de:
put
good_pages.sort()
beforereturn html.UL(
This sorts it on the pagename. (which is fine for me)
To sort on the title, it seems you need to pass a compare function to the sort operation: http://effbot.org/zone/python-list.htm#sorting. But I am also new to python.
comment:5 Changed 17 years ago by
This sorts it on the pagename. (which is fine for me)
If you also do the other changes I suggested, it should sort on the title, becouse I changed the order of p and t (pagename and title).
comment:6 Changed 17 years ago by
Confirmed as a problem for me, too. Sorting on pagename would be fine for me, too.
comment:7 Changed 17 years ago by
Did you have a look on my suggest obove? I testet it and it works.
comment:8 Changed 10 years ago by
Owner: | Noah Kantrowitz deleted |
---|
comment:9 Changed 10 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The plugin is deprecated since Trac has equivalent functionality as of trac:milestone:1.1.2. If you find any missing function please open a ticket for Trac.
This is till a problem.