changeset 5657:516d165c4bbf

WikiConfigHelp macro: make heading and description display optional, heading level as a parameter (default 2)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 23 Apr 2010 20:52:46 +0200
parents c7dd42405e5a
children 24d7e2f450bf
files MoinMoin/macro/WikiConfigHelp.py
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/WikiConfigHelp.py	Sun Apr 11 18:55:31 2010 +0200
+++ b/MoinMoin/macro/WikiConfigHelp.py	Fri Apr 23 20:52:46 2010 +0200
@@ -7,7 +7,7 @@
 Dependencies = ['user'] # table headings are translated to user language
 generates_headings = True
 
-def macro_WikiConfigHelp(macro, section=None):
+def macro_WikiConfigHelp(macro, section=None, show_heading=True, show_descriptions=True, heading_level=2):
     request = macro.request
     _ = request.getText
     f = macro.request.formatter
@@ -25,13 +25,15 @@
 
     for groupname, addgroup, optsdict in groups:
         heading, desc, opts = optsdict[groupname]
-        ret.extend([
-            f.heading(1, 1, id=groupname),
-            ## XXX: translate description?
-            f.text(heading),
-            f.heading(0, 1),
-        ])
-        if desc:
+        if show_heading:
+            ret.extend([
+                f.heading(1, heading_level, id=groupname),
+                ## XXX: translate description?
+                f.text(heading),
+                f.heading(0, heading_level),
+            ])
+
+        if desc and show_descriptions:
             ret.extend([
                 f.paragraph(1),
                 f.text(desc),