Difference between revisions of "CreateHelpPageTest"

From OPENRESEARCH th copy Wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
{{Sourcecode
 
{{Sourcecode
 
|id=CreateHelpPageTest
 
|id=CreateHelpPageTest
|lang=python
+
|lang=jinja
 
|since=2021/02/05
 
|since=2021/02/05
|text=rows=context["rows"]
+
|text=
for row in rows:
+
<pre>
        help_template = '[[File:Help_Icon.png|right]]\n' \
+
[[File:Help_Icon.png|right]]\n'
                        '== Help for {{ name }} ==\n' \
+
== Help for {{ name }} ==\n'
                        '{% raw %}{{{% endraw %}#ask: [[Topic name::{{ name }}]]' \
+
{% raw %}{{{% endraw %}#ask: [[Topic name::{{ name }}]]
                        '|mainlabel=-' \
+
|mainlabel=-
                        '|?Topic icon = icon' \
+
|?Topic icon = icon
                        '|? = Topic' \
+
|? = Topic
                        '|?Topic name = name' \
+
|?Topic name = name
                        '|?Topic pluralName = pluralName' \
+
|?Topic pluralName = pluralName
                        '|?Topic documentation = documentation' \
+
|?Topic documentation = documentation
                        '{% raw %}}}{% endraw %}\n' \
+
{% raw %}}}{% endraw %}
                        '=== Documentation ===\n' \
+
=== Documentation ===
                        '{{ documentation }}\n' \
+
{{ documentation }}
                        '=== Example {{ pluralName }} ===\n' \
+
=== Example {{ pluralName }} ===
                        '{% raw %}{{{% endraw %}#ask: [[Concept:{{ name }}]]{% raw %}}}{% endraw %}\n' \
+
{% raw %}{{{% endraw %}#ask: [[Concept:{{ name }}]]{% raw %}}}{% endraw %}
                        '=== Properties ===\n' \
+
=== Properties ===
                        '{% raw %}{{{% endraw %}#ask: [[Concept:Property]][[Property topic::Concept: {{ name }} ]]' \
+
{% raw %}{{{% endraw %}#ask: [[Concept:Property]][[Property topic::Concept: {{ name }} ]]
                        '| ?Property documentation = documentation' \
+
| ?Property documentation = documentation
                        '| ?Property type = type' \
+
| ?Property type = type
                        '| ?Property name = name' \
+
| ?Property name = name
                        '| ?Property label = label' \
+
| ?Property label = label
                        '| ?Property allowedValues = allowedValues' \
+
| ?Property allowedValues = allowedValues
                        '| ?Property mandatory = mandatory' \
+
| ?Property mandatory = mandatory
                        '| ?Property uploadable = uploadable' \
+
| ?Property uploadable = uploadable
                        '|format=table' \
+
|format=table
                        '{% raw %}}}{% endraw %}\n' \
+
{% raw %}}}{% endraw %}
                        '{{ uml }}\n' \
+
{{ uml }}
                        '{{ seealso }}\n' \
+
{{ seealso }}
                        '[[Category:{{ name }}]]'
+
[[Category:{{ name }}]]
        from jinja2 import Template
+
</pre>
        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")
 
 
|storemode=property
 
|storemode=property
 
}}
 
}}
  
 
=Freitext=
 
=Freitext=

Revision as of 09:33, 9 February 2021

Sourcecode

Sourcecode
edit
id  CreateHelpPageTest
lang  jinja
author  
since  2021/02/05
test  
'"`UNIQ--pre-00000000-QINU`"'
url  

Freitext