changeset 5263:5155ed62a9c5

macro WikiConfigHelp: added section keyword for selecting a subset of the description, e.g. <<WikiConfigHelp(section="xapian")>>
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 07 Nov 2009 23:57:46 +0100
parents 5b3c8d341dfa
children e883fba8a37e
files MoinMoin/macro/WikiConfigHelp.py
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/WikiConfigHelp.py	Sat Nov 07 19:24:47 2009 +0100
+++ b/MoinMoin/macro/WikiConfigHelp.py	Sat Nov 07 23:57:46 2009 +0100
@@ -7,17 +7,20 @@
 Dependencies = ['user'] # table headings are translated to user language
 generates_headings = True
 
-def macro_WikiConfigHelp(macro):
+def macro_WikiConfigHelp(macro, section=None):
     request = macro.request
     _ = request.getText
     f = macro.request.formatter
     ret = []
 
     groups = []
-    for groupname in multiconfig.options:
-        groups.append((groupname, True, multiconfig.options))
-    for groupname in multiconfig.options_no_group_name:
-        groups.append((groupname, False, multiconfig.options_no_group_name))
+    if section and section in multiconfig.options:
+        groups.append((section, True, multiconfig.options))
+    else:
+        for groupname in multiconfig.options:
+            groups.append((groupname, True, multiconfig.options))
+        for groupname in multiconfig.options_no_group_name:
+            groups.append((groupname, False, multiconfig.options_no_group_name))
     groups.sort()
 
     for groupname, addgroup, optsdict in groups: