== Description == Add to !WikiConfigHelp macro some functionality to customize its look. It is needed for example for HelpOnXapian, HelpOnOpenIDProvider, HelpOnConfiguration, and HelpOnAccessControlLists where first level headers break page structure. The macro currently generates silly output for HelpOnXapian, HelpOnOpenIDProvider, and HelpOnAccessControlLists. For example, the first line generated by the macro on the HelpOnXapian page says: ''Configuration of the Xapian based indexed search, see HelpOnXapian''. Using `show_descriptions=False` on the above 3 pages will eliminate this. Since Moin 1.5, a better default heading_level would be 2 rather than 1. The 4 pages above are the only pages that use the macro on 1.9 moin master and moinmo.in and all 4 require H2 headings. I changed the default from 1 to 2 on the patch below. If you disagree, change it back. Modified patch tested on my moin 1.9.2 test system -- works fine. -- RogerHaase <> While I still feel the default level should be h2, it doesn't matter. After fixing the 4 pages in 1.9 moin master, I found HelpOnConfiguration needs h3 headings, the other 3 pages work better with `show_heading=False`. -- RogerHaase <> == Patch == This patch add ability to configure displaying and level of headers and displaying of descriptions. {{{#!diff --- /data/programs/moin-1.9.0rc2/MoinMoin/macro/WikiConfigHelp.old.py 2009-11-29 21:39:40.000000000 +0300 +++ /data/programs/moin-1.9.0rc2/MoinMoin/macro/WikiConfigHelp.py 2009-11-29 21:43:10.000000000 +0300 @@ -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), }}} Implemented in [http://hg.moinmo.in/moin/1.9/rev/516d165c4bbf]. ---- CategoryFeatureImplemented