Difference between pages "Template:!!" and "Template:!-"

From LCA2015 Delegate wiki
(Difference between pages)
Jump to: navigation, search
(Created a metatemplate for the double pipe character.)
 
(Created a metatemplate for the pipe and dash character combo for table rows.)
 
Line 1: Line 1:
<includeonly>|</includeonly><noinclude>This is an auxiliary template allowing "||" to be encoded within template parameters. The "||" delimiter for a Wiki table has to be escaped by a template if it's used within a template.
+
<includeonly>|-</includeonly><noinclude>
 +
This is an auxiliary template allowing "|-" to be encoded within template parameters. The "|-" delimiter for a Wiki table has to be escaped by a template if it's used within a template.
  
This template can be used to parse tables in templates as a shortcut to using <nowiki>{{!}}</nowiki> twice. For example, the table:
+
This template can be used to parse tables correctly in templates. For example, the table:
 
<pre>
 
<pre>
 
{| some table
 
{| some table
 
|- some row
 
|- some row
| some cell || some cell
+
| some cell
 +
|
 
|}
 
|}
 +
}}
 
</pre>
 
</pre>
Can be coded as:
+
Can be written as:
 
<pre>
 
<pre>
 
{{sometemplate|someparameter={
 
{{sometemplate|someparameter={
 
     {{!}} some table
 
     {{!}} some table
     {{!}}- some row
+
     {{!-}} some row
     {{!}} some cell {{!!}} some cell
+
     {{!}} some cell
   |}
+
    {{!}}
 +
    {{!}}
 +
   }
 
}}
 
}}
 
</pre>
 
</pre>
 
[[Category:Metatemplates]]
 
[[Category:Metatemplates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 14:20, 9 December 2014

This is an auxiliary template allowing "|-" to be encoded within template parameters. The "|-" delimiter for a Wiki table has to be escaped by a template if it's used within a template.

This template can be used to parse tables correctly in templates. For example, the table:

{| some table
|- some row
| some cell
|
|}
}}

Can be written as:

{{sometemplate|someparameter={
    {{!}} some table
    {{!-}} some row
    {{!}} some cell
    {{!}}
    {{!}}
  }
}}