<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.shadowrunwiki.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AFormat_TemplateData%2Fdoc</id>
	<title>Module:Format TemplateData/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.shadowrunwiki.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AFormat_TemplateData%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.shadowrunwiki.com/index.php?title=Module:Format_TemplateData/doc&amp;action=history"/>
	<updated>2026-06-04T08:54:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://www.shadowrunwiki.com/index.php?title=Module:Format_TemplateData/doc&amp;diff=1563&amp;oldid=prev</id>
		<title>Catrone3: Created page with &quot;{{Lua|Module:Text}} &#039;&#039;&lt;code&gt;Format TemplateData&lt;/code&gt;&#039;&#039;&#039; – Module with auxilary functions for template documentation, especially by TemplateData.  Core functionality is improved presentation on documentation pages.  __TOC__  == Functions for templates ==  === Details === ; f  : Improve TemplateData-presentation; used in Template:Format TemplateData : &#039;&#039;Parameters of template transclusion environment (all optional):&#039;&#039;&lt;section begin=&quot;templatePar&quot; /&gt; ::; 1 ::: JSON s...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.shadowrunwiki.com/index.php?title=Module:Format_TemplateData/doc&amp;diff=1563&amp;oldid=prev"/>
		<updated>2024-07-08T02:43:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Lua|Module:Text}} &amp;#039;&amp;#039;&amp;lt;code&amp;gt;Format TemplateData&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; – Module with auxilary functions for template documentation, especially by TemplateData.  Core functionality is improved presentation on documentation pages.  __TOC__  == Functions for templates ==  === Details === ; f  : Improve TemplateData-presentation; used in &lt;a href=&quot;/Template:Format_TemplateData&quot; title=&quot;Template:Format TemplateData&quot;&gt;Template:Format TemplateData&lt;/a&gt; : &amp;#039;&amp;#039;Parameters of template transclusion environment (all optional):&amp;#039;&amp;#039;&amp;lt;section begin=&amp;quot;templatePar&amp;quot; /&amp;gt; ::; 1 ::: JSON s...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Lua|Module:Text}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;code&amp;gt;Format TemplateData&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; – Module with auxilary functions for template documentation, especially by TemplateData.&lt;br /&gt;
&lt;br /&gt;
Core functionality is improved presentation on documentation pages.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Functions for templates ==&lt;br /&gt;
&lt;br /&gt;
=== Details ===&lt;br /&gt;
; f &lt;br /&gt;
: Improve TemplateData-presentation; used in [[Template:Format TemplateData]]&lt;br /&gt;
: &amp;#039;&amp;#039;Parameters of template transclusion environment (all optional):&amp;#039;&amp;#039;&amp;lt;section begin=&amp;quot;templatePar&amp;quot; /&amp;gt;&lt;br /&gt;
::; 1&lt;br /&gt;
::: JSON string or &amp;lt;code&amp;gt;&amp;amp;lt;templatedata&amp;gt;&amp;lt;/code&amp;gt; object&lt;br /&gt;
::; JSON&lt;br /&gt;
::: JSON string&lt;br /&gt;
::: (precedes &amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
::: Transition from &amp;lt;code&amp;gt;&amp;amp;lt;templatedata&amp;gt;&amp;lt;/code&amp;gt; objects with pipe symbols needs special attention: Pipes are to be represented as &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, on double curly brackets one should be encoded by HTML entity.&lt;br /&gt;
::; TOC&lt;br /&gt;
::: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; – Insert table of contents after general purpose descriptions; but before parameter list, if present&lt;br /&gt;
::; lang&lt;br /&gt;
::: Language code according to ISO 639 etc.&lt;br /&gt;
::; lazy&lt;br /&gt;
::: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; – Presentation only, do not generate an effective data block&lt;br /&gt;
::: For general method descriptions.&lt;br /&gt;
::; debug&lt;br /&gt;
::: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; – developer mode&lt;br /&gt;
::; source&lt;br /&gt;
::: &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; – show effective JSON source text (after template expansion) for debugging&amp;lt;section end=&amp;quot;templatePar&amp;quot; /&amp;gt;&lt;br /&gt;
: &amp;#039;&amp;#039;Parameters of&amp;#039;&amp;#039; &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt; &amp;#039;&amp;#039;for particular project adaption (all optional):&amp;#039;&amp;#039;&lt;br /&gt;
::; lang&lt;br /&gt;
::: Language code according to ISO 639 etc.&lt;br /&gt;
::; debug&lt;br /&gt;
::: Development mode, if provided and not equal &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
::; cat&lt;br /&gt;
::: Title of a maintenance category on invalid parameter value etc.&lt;br /&gt;
::: &amp;#039;&amp;#039;&amp;#039;Deprecated&amp;#039;&amp;#039;&amp;#039; – use [[#config|configuration module]]&lt;br /&gt;
::; docpageCreate&lt;br /&gt;
::: Pattern for creation of subpage names; &amp;lt;code&amp;gt;%s/Doku&amp;lt;/code&amp;gt;&lt;br /&gt;
::: &amp;#039;&amp;#039;&amp;#039;Deprecated&amp;#039;&amp;#039;&amp;#039; – use [[#config|configuration module]]&lt;br /&gt;
::; docpageDetect&lt;br /&gt;
::: Pattern for recognition of subpage names; &amp;lt;code&amp;gt;/Doku$&amp;lt;/code&amp;gt;&lt;br /&gt;
::: &amp;#039;&amp;#039;&amp;#039;Deprecated&amp;#039;&amp;#039;&amp;#039; – use [[#config|configuration module]]&lt;br /&gt;
::; msgDescMiss&lt;br /&gt;
::: Localisation: complaint text on missing &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;&lt;br /&gt;
::: &amp;#039;&amp;#039;&amp;#039;Deprecated&amp;#039;&amp;#039;&amp;#039; – use [[#config|configuration module]]&lt;br /&gt;
: &amp;#039;&amp;#039;Returns:&amp;#039;&amp;#039; HTML code; and/or error message, probably with &amp;lt;code&amp;gt;class=&amp;quot;error&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
; failsafe   {{Anker|failsafe}}&lt;br /&gt;
: Version management&lt;br /&gt;
&lt;br /&gt;
== Functions for Lua modules (API) ==&lt;br /&gt;
&lt;br /&gt;
Some functions described above can be used by other modules:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local lucky, TemplateData = pcall( require, &amp;quot;Modul:Format TemplateData&amp;quot; )&lt;br /&gt;
if type( TemplateData ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
    TemplateData = TemplateData.TemplateData()&lt;br /&gt;
else&lt;br /&gt;
    -- failure; TemplateData is the error message&lt;br /&gt;
    return &amp;quot;&amp;lt;span class=&amp;#039;error&amp;#039;&amp;gt;&amp;quot; .. TemplateData .. &amp;quot;&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; TemplateData.[[#failsafe|failsafe]](atleast)&lt;br /&gt;
:# atleast&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;optional&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;nil&amp;#039;&amp;#039; or minimal version request or &amp;lt;code&amp;gt;&amp;quot;wikidata&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
: Returns: &amp;#039;&amp;#039;string&amp;#039;&amp;#039; or &amp;#039;&amp;#039;false&amp;#039;&amp;#039;&lt;br /&gt;
; TemplateData.getPlainJSON(adapt)&lt;br /&gt;
: Reduce enhanced JSON information to MediaWiki JSON&lt;br /&gt;
:# adapt&amp;lt;br /&amp;gt; &amp;#039;&amp;#039;string&amp;#039;&amp;#039;, with JSON (enhanced)&lt;br /&gt;
: Returns: &amp;#039;&amp;#039;string&amp;#039;&amp;#039;, with JSON (MediaWiki )&lt;br /&gt;
; TemplateData.test(adapt, arglist)&lt;br /&gt;
: Simulation of template functionality&lt;br /&gt;
:# adapt&amp;lt;br /&amp;gt; &amp;#039;&amp;#039;table&amp;#039;&amp;#039;, &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt; parameters&lt;br /&gt;
:# arglist&amp;lt;br /&amp;gt; &amp;#039;&amp;#039;table&amp;#039;&amp;#039;, template parameters&lt;br /&gt;
: Returns: &amp;#039;&amp;#039;string&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Currently focussing on one template only:&lt;br /&gt;
* [[Template:Format TemplateData]]&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
* [[Module:Text|Text]]&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
A local module [[Module:Format TemplateData/config]], if present, facilitates adaptions to the local project.&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;table&amp;#039;&amp;#039; is expected via &amp;lt;code&amp;gt;mw.loadData&amp;lt;/code&amp;gt;. The following entries are optional components:&lt;br /&gt;
; catProblem&lt;br /&gt;
: Title of a maintenance category on invalid parameter value etc.&lt;br /&gt;
; classNoNumTOC&lt;br /&gt;
: Name of class for the table of contents; especially to suppress numbering.&lt;br /&gt;
: &amp;lt;code&amp;gt;nonumtoc&amp;lt;/code&amp;gt;&lt;br /&gt;
; classTable&lt;br /&gt;
: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with classes for the table of parameters.&lt;br /&gt;
: &amp;lt;code&amp;gt;{ &amp;quot;wikitable&amp;quot; }&amp;lt;/code&amp;gt;&lt;br /&gt;
; cssParams&lt;br /&gt;
: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with CSS assignments for formatting of single parameters&lt;br /&gt;
; cssParWrap&lt;br /&gt;
: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with CSS assignments for formatting of the entire parameter table&lt;br /&gt;
; docpageCreate&lt;br /&gt;
: Pattern for creation of subpage names; &amp;lt;code&amp;gt;%s/Doku&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;%s/Doku&amp;lt;/code&amp;gt;&lt;br /&gt;
; docpageDetect&lt;br /&gt;
: Pattern for recognition of subpage names; &amp;lt;code&amp;gt;/Doku$&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;/Doku$&amp;lt;/code&amp;gt;&lt;br /&gt;
; help*********&lt;br /&gt;
: Link targets for context sensitive help on details&lt;br /&gt;
; helpBoolean&lt;br /&gt;
; helpContent&lt;br /&gt;
; helpDate&lt;br /&gt;
; helpFile&lt;br /&gt;
; helpFormat&lt;br /&gt;
: Link target on help about wikitext transclusion layout&lt;br /&gt;
; helpLine&lt;br /&gt;
; helpNumber&lt;br /&gt;
; helpPage&lt;br /&gt;
; helpString&lt;br /&gt;
; helpTemplate&lt;br /&gt;
; helpURL&lt;br /&gt;
; helpUser&lt;br /&gt;
; msgDescMiss&lt;br /&gt;
: Localisation: complaint text on missing &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;&lt;br /&gt;
; permit&lt;br /&gt;
: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with specification of properties for a single parameter; components:&lt;br /&gt;
:; boole&lt;br /&gt;
:: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with specification for &amp;#039;&amp;#039;boolean&amp;#039;&amp;#039; presentation&lt;br /&gt;
:: Two components &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; – each one &amp;#039;&amp;#039;table&amp;#039;&amp;#039;:&lt;br /&gt;
::; css&lt;br /&gt;
::: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with CSS for this explanation of the value&lt;br /&gt;
::; lead&lt;br /&gt;
::: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; – show explanation for &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; respectively preceding the value&lt;br /&gt;
::: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; – show explanation for &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; respectively following the value&lt;br /&gt;
::; show&lt;br /&gt;
::: explanation; &amp;#039;&amp;#039;string&amp;#039;&amp;#039; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to suppress&lt;br /&gt;
:; css&lt;br /&gt;
:: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with specifications for rendering of the parameter table; components:&lt;br /&gt;
::; tablehead&lt;br /&gt;
::: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with CSS for table head&lt;br /&gt;
::; required&lt;br /&gt;
::: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with CSS for &amp;lt;code&amp;gt;required&amp;lt;/code&amp;gt;&lt;br /&gt;
::; suggested&lt;br /&gt;
::: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with CSS for &amp;lt;code&amp;gt;suggested&amp;lt;/code&amp;gt;&lt;br /&gt;
::; optional&lt;br /&gt;
::: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with CSS for &amp;lt;code&amp;gt;optional&amp;lt;/code&amp;gt;&lt;br /&gt;
::; deprecated&lt;br /&gt;
::: &amp;#039;&amp;#039;table&amp;#039;&amp;#039; with CSS for &amp;lt;code&amp;gt;deprecated&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Catrone3</name></author>
	</entry>
</feed>