1
# -*- coding: iso-8859-1 -*-
3
MoinMoin - Wiki Configuration Help
5
from MoinMoin.config import multiconfig
8
generates_headings = True
10
def macro_WikiConfigHelp(macro):
11
request = macro.request
13
f = macro.request.formatter
17
for groupname in multiconfig.options:
18
groups.append((groupname, True, multiconfig.options))
19
for groupname in multiconfig.options_no_group_name:
20
groups.append((groupname, False, multiconfig.options_no_group_name))
23
for groupname, addgroup, optsdict in groups:
24
heading, desc, opts = optsdict[groupname]
26
f.heading(1, 1, id=groupname),
27
## XXX: translate description?
40
f.table_cell(1), f.strong(1), f.text(_('Variable name')), f.strong(0), f.table_cell(0),
41
f.table_cell(1), f.strong(1), f.text(_('Default')), f.strong(0), f.table_cell(0),
42
f.table_cell(1), f.strong(1), f.text(_('Description')), f.strong(0), f.table_cell(0),
47
for name, default, description in opts:
49
name = groupname + '_' + name
50
if isinstance(default, multiconfig.DefaultExpression):
51
default_txt = default.text
53
default_txt = '%r' % (default, )
54
if len(default_txt) <= 30:
55
default_txt = f.text(default_txt)
57
default_txt = f.span(1, title=default_txt) + f.text('...') + f.span(0)
58
description = _(description or '', wiki=True)
61
f.table_cell(1), f.text(name), f.table_cell(0),
62
f.table_cell(1), f.code(1, css="backtick"), default_txt, f.code(0), f.table_cell(0),
63
f.table_cell(1), description, f.table_cell(0),
66
ret.append(f.table(0))