Difference between revisions of "Module:Tlx"

From blackwiki
Jump to navigation Jump to search
m (79 revisions imported)
m (4 revisions imported)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><!--
+
<code><nowiki>{{</nowiki>{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!--
    --><code><!--
+
-->[[{{{lang|{{{LANG|}}}}}}{{{sister|{{{SISTER|}}}}}}{{ns:Template}}:{{{1|}}}|{{{1|}}}]]<!--
        --><nowiki>{{</nowiki>{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!--
+
  -->{{#if:{{{2|}}}  |&#124;{{{2}}}}}<!--
                    -->[[{{{LANG|}}}{{{SISTER|}}}{{ns:Template}}:{{{1|}}}|{{{1|}}}]]<!--
+
  -->{{#if:{{{3|}}}  |&#124;{{{3}}}}}<!--
                          -->{{#if:{{{2|}}}  |&#124;{{{2}}}}}<!--
+
  -->{{#if:{{{4|}}}  |&#124;{{{4}}}}}<!--
                          -->{{#if:{{{3|}}}  |&#124;{{{3}}}}}<!--
+
  -->{{#if:{{{5|}}}  |&#124;{{{5}}}}}<!--
                          -->{{#if:{{{4|}}}  |&#124;{{{4}}}}}<!--
+
  -->{{#if:{{{6|}}}  |&#124;{{{6}}}}}<!--
                          -->{{#if:{{{5|}}}  |&#124;{{{5}}}}}<!--
+
  -->{{#if:{{{7|}}}  |&#124;{{{7}}}}}<!--
                          -->{{#if:{{{6|}}}  |&#124;{{{6}}}}}<!--
+
  -->{{#if:{{{8|}}}  |&#124;{{{8}}}}}<!--
                          -->{{#if:{{{7|}}}  |&#124;{{{7}}}}}<!--
+
  -->{{#if:{{{9|}}}  |&#124;{{{9}}}}}<!--
                          -->{{#if:{{{8|}}}  |&#124;{{{8}}}}}<!--
+
  -->{{#if:{{{10|}}} |&#124;{{{10}}}}}<!--
                          -->{{#if:{{{9|}}}  |&#124;{{{9}}}}}<!--
+
  -->{{#if:{{{11|}}} |&#124;{{{11}}}}}<!--
                          -->{{#if:{{{10|}}} |&#124;{{{10}}}}}<!--
+
  -->{{#if:{{{12|}}} |&#124;{{{12}}}}}<!--
                          -->{{#if:{{{11|}}} |&#124;{{{11}}}}}<!--
+
  -->{{#if:{{{13|}}} |&#124;{{{13}}}}}<!--
                          -->{{#if:{{{12|}}} |&#124;{{{12}}}}}<!--
+
  -->{{#if:{{{14|}}} |&#124;{{{14}}}}}<!--
                          -->{{#if:{{{13|}}} |&#124;{{{13}}}}}<!--
+
  -->{{#if:{{{15|}}} |&#124;{{{15}}}}}<!--
                          -->{{#if:{{{14|}}} |&#124;{{{14}}}}}<!--
+
  -->{{#if:{{{16|}}} |&#124;{{{16}}}}}<!--
                          -->{{#if:{{{15|}}} |&#124;{{{15}}}}}<!--
+
  -->{{#if:{{{17|}}} |&#124;{{{17}}}}}<!--
                          -->{{#if:{{{16|}}} |&#124;{{{16}}}}}<!--
+
  -->{{#if:{{{18|}}} |&#124;{{{18}}}}}<!--
                          -->{{#if:{{{17|}}} |&#124;{{{17}}}}}<!--
+
  -->{{#if:{{{19|}}} |&#124;{{{19}}}}}<!--
                          -->{{#if:{{{18|}}} |&#124;{{{18}}}}}<!--
+
  -->{{#if:{{{20|}}} |&#124;{{{20}}}}}<!--
                          -->{{#if:{{{19|}}} |&#124;{{{19}}}}}<!--
+
  -->{{#if:{{{21|}}} |&#124;''...''}}<!--
                          -->{{#if:{{{20|}}} |&#124;{{{20}}}}}<!--
+
--><nowiki>}}</nowiki></code>{{#if: {{{LANG|}}} | {{Z181}} | {{#if: {{{SISTER|}}} | {{Z181}} }} }}<noinclude>
                          -->{{#if:{{{21|}}} |&#124;''...''}}<!--
+
{{Documentation}}
        --><nowiki>}}</nowiki><!--
+
</noinclude>
    --></code><!--
 
--></includeonly><noinclude>
 
{{Documentation}}</noinclude>
 

Latest revision as of 17:24, 29 September 2020

{{[[Template:|]]}}

Module documentation[view] [edit] [history] [purge]

Usage

{{#invoke:Tlx|function_name|SISTER=sister project name}}

Implements a version of {{tlx}}, {{tlxs}}, {{tlxb}}, {{tlxi}}, {{tlxc}}, and {{temt}}.

{{tlx}} and {{temt}} use the function name tlx, {{tlxs}} uses tlxs, {{tlxb}} uses tlxb, {{tlxi}} uses tlxi, and {{tlxs}} uses tlx with |SISTER=commons:.

Generally, a call to this module can be placed at the front of a template call to display formatted code instead of the template output. For example, if this module is implemented at {{tlx/sandbox}}, a function call such as {{convert|1|m|disp=flip}} can be displayed as formatted text using the code {{tlx/sandbox|convert|1|m|disp=flip}}, which outputs Template:Tlx/sandbox.

This has the following caveats:

  • |LANG=, |SISTER=, and |subst= are reserved for compatibility with the legacy {{tlx}} template. In order to display {{x0|LANG=de|SISTER=wikt|subst=yes}} you would need to use workarounds from the old template such as {{tlx/sandbox|x0|<nowiki>LANG=en</nowiki>|SISTER{{=}}wikt|4=subst=yes}} to produce Template:Tlx/sandbox.
  • Parameters are presented in alphabetical order, starting with numbered parameters, regardless of input order. {{tlx/sandbox|x0|z=y|x=w|a|b}} displays Template:Tlx/sandbox
  • Since the |1= parameter is used for the template name, numbered parameters where the number is explicitly specified must be offset by one (as was true with the legacy {{tlx}} template): {{tlx/sandbox|x0|2=first|3=second|4=third=***}} produces Template:Tlx/sandbox.
  • NOTE: you must be careful not to double-define a parameter. {{tlx/sandbox|x0|first|2=second=**}} will output Template:Tlx/sandbox (and generate a warning) since the 2 parameter was defined twice. Use {{tlx/sandbox|x0|first|3=second=**}} to display Template:Tlx/sandbox.
  • To display the number of a numbered parameter explicitly, the same workarounds from the legacy template still work: {{tlx/sandbox|x0|<nowiki>1=first</nowiki>|2{{=}}second|4=3=third}} produces Template:Tlx/sandbox