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.

Patch

This patch add ability to configure displaying and level of headers and displaying of descriptions.

   1 --- /data/programs/moin-1.9.0rc2/MoinMoin/macro/WikiConfigHelp.old.py   2009-11-29 21:39:40.000000000 +0300
   2 +++ /data/programs/moin-1.9.0rc2/MoinMoin/macro/WikiConfigHelp.py       2009-11-29 21:43:10.000000000 +0300
   3 @@ -7,7 +7,7 @@
   4  Dependencies = ['user'] # table headings are translated to user language
   5  generates_headings = True
   6  
   7 -def macro_WikiConfigHelp(macro, section=None):
   8 +def macro_WikiConfigHelp(macro, section=None, show_heading=True, show_descriptions=True, heading_level=2):
   9      request = macro.request
  10      _ = request.getText
  11      f = macro.request.formatter
  12 @@ -25,13 +25,15 @@
  13  
  14      for groupname, addgroup, optsdict in groups:
  15          heading, desc, opts = optsdict[groupname]
  16 -        ret.extend([
  17 -            f.heading(1, 1, id=groupname),
  18 -            ## XXX: translate description?
  19 -            f.text(heading),
  20 -            f.heading(0, 1),
  21 -        ])
  22 -        if desc:
  23 +        if show_heading:
  24 +            ret.extend([
  25 +                f.heading(1, heading_level, id=groupname),
  26 +                ## XXX: translate description?
  27 +                f.text(heading),
  28 +                f.heading(0, heading_level),
  29 +            ])
  30 +
  31 +        if desc and show_descriptions:
  32              ret.extend([
  33                  f.paragraph(1),
  34                  f.text(desc),

Implemented in [http://hg.moinmo.in/moin/1.9/rev/516d165c4bbf].


CategoryFeatureImplemented

MoinMoin: FeatureRequests/WikiConfigHelpCustomization (last edited 2010-04-24 06:17:56 by EugeneSyromyatnikov)