CreateHelpPageTest
Revision as of 18:42, 7 February 2021 by Tim Holzheim (talk | contribs) (Created page with "=Sourcecode= {{Sourcecode |id=CreateHelpPageTest |lang=python |since=2021/02/05 |text=rows=context["rows"] for row in rows: help_template = 'File:Help_Icon.png|ri...")
Sourcecode
Sourcecode | |
---|---|
id | CreateHelpPageTest |
lang | python |
author | |
since | 2021/02/05 |
test | rows=context["rows"]
for row in rows:
help_template = '[[File:Help_Icon.png|right]]' \
'== Help for [[:Template:Name]] ==' \
'{% raw %}mainlabel=-' \
'{% endraw %}' \
'=== Documentation ===' \
'[[:Template:Documentation]]' \
'=== Example [[:Template:PluralName]] ===' \
'{% raw %}{{{% endraw %}#ask: [[Concept:[[:Template:Name]]]]{% raw %}}}{% endraw %}' \
'=== Properties ===' \
'{% raw %} ?Property documentation = documentation' \
'{% endraw %}' \
'[[:Template:Uml]]' \
'[[:Template:Seealso]]' \
'[[Category:[[:Template:Name]]]]'
from jinja2 import Template
template = Template(help_template)
page_content = template.render(name=row['name'],
documentation=row['documentation'],
pluralName=row['pluralName'],
uml=row['uml'] if row['uml'] else "",
seealso=row['seealso'] if row['seealso'] else "")
page = context['wikiclient'].getPage(f"Help:{row['name']}")
page.edit(page_content, "Created for test purposes by lambdaactions")
|
url |