1.1 --- a/README.txt Tue Feb 10 00:33:57 2009 +0100
1.2 +++ b/README.txt Tue Feb 10 01:19:49 2009 +0100
1.3 @@ -51,6 +51,11 @@
1.4
1.5 This ensures that the styles are made available to the browser.
1.6
1.7 +Recommended Software
1.8 +--------------------
1.9 +
1.10 +http://moinmo.in/HelpOnXapian
1.11 +
1.12 Troubleshooting
1.13 ---------------
1.14
2.1 --- a/macros/CategoryMenu.py Tue Feb 10 00:33:57 2009 +0100
2.2 +++ b/macros/CategoryMenu.py Tue Feb 10 01:19:49 2009 +0100
2.3 @@ -20,6 +20,10 @@
2.4
2.5 category_regexp = None
2.6
2.7 +# From MoinMoin.search.queryparser...
2.8 +
2.9 +category_membership_regexp_str = r'(?m)(^-----*\s*\r?\n)(^##.*\r?\n)*^(?!##)(.*)\b%s\b'
2.10 +
2.11 # Utility functions.
2.12
2.13 def isMoin15():
2.14 @@ -121,15 +125,14 @@
2.15 for category in categories:
2.16 category_name, category_pagename = category
2.17
2.18 - pages_in_category = getPages(category_pagename, request)
2.19 - pagenames_in_category = [p.page_name for p in pages_in_category]
2.20 page_is_category = page.page_name == category_pagename
2.21 + category_membership_regexp = re.compile(category_membership_regexp_str % category_pagename)
2.22 + page_in_category = category_membership_regexp.search(page.get_raw_body())
2.23
2.24 # Generate the submenu where appropriate.
2.25
2.26 if selected_category_names and category_name in selected_category_names or \
2.27 - not selected_category_names and (
2.28 - page_is_category or page.page_name in pagenames_in_category):
2.29 + not selected_category_names and (page_is_category or page_in_category):
2.30
2.31 if page_is_category:
2.32 output.append(fmt.listitem(on=1, attr={"class" : "selected current"}))
2.33 @@ -142,6 +145,11 @@
2.34
2.35 output.append(fmt.bullet_list(on=1, attr={"class" : "category-submenu"}))
2.36
2.37 + # Get the pages and page names in the category.
2.38 +
2.39 + pages_in_category = getPages(category_pagename, request)
2.40 + pagenames_in_category = [p.page_name for p in pages_in_category]
2.41 +
2.42 # Visit each page in the category.
2.43
2.44 last_parts = []