Cowboy's Wiki:Lua/Modul/Vorlage:TemplateDataGenerator/en: Unterschied zwischen den Versionen

Aus Cowboy's Wiki
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „{{LuaModuleDoc}} <onlyinclude>'''<code>{{ns:10}}:TemplateDataGenerator</code>''' – Module for generation of a skeleton for TemplateData from the parameter us…“)
(kein Unterschied)

Aktuelle Version vom 12. Oktober 2014, 23:51 Uhr

{{#invoke:Vorlage:LuaModuleDoc|nav |langsRequest = |noCat = |noHint = |categoryDocs = Cowboy's Wiki:Lua/Modul |langsDefault = de en |langsMore = dsb eo fr hsb |nsDocs = 4 |pageDocRoot = Lua/Modul |pageErr = Cowboy's Wiki:Lua/Modul-Navigationsfehler |pageNav = Cowboy's Wiki:Lua/Modul-Navigation |pageTemplateInsert = Cowboy's Wiki:Lua/Vorlagenprogrammierung |subTest = Test }} Vorlage:TemplateDataGenerator – Module for generation of a skeleton for TemplateData from the parameter usage within template programming.

Functions for Templates

Trigger analysis of template around (base page).
  • No parameters on #invoke.
  • Yields block to be inserted by copy&paste.

Template wrapping

The module is supposed to be wrapped for convenience into something like a template


That template may be “transcluded” with one parameter: sort alias 1 – if that is provided with the value 1, parameter list will be sorted in alphabetical order.

Productive usage

When editing a template (documentation) page, users are supposed to insert the following line, where TemplateData shall appear:


After click on [Preview], the generated lines are displayed and can be inserted by copy & paste to replace the temporary “transclusion”.

If forgotten to remove on saving, subst comes into effect and the plain lines are stored into source text. Next time someone will do the cleanup.

Functions for Lua modules

getBlock( about, ahead, alphabetical )
Trigger analysis of template like f but from Lua call.
  • about – string; page title related to template code on base page
  • ahead – string, number or nil; namespace (Template:)
  • alphabetical – boolean or nil; sort parameter list