Template:Code: Difference between revisions

From Modded Wiki
Jump to navigation Jump to search
mNo edit summary
add support for a different final delimiter (currently only "pretty" which gives ", and " before the final item); prettify code a bit
Line 1: Line 1:
{{
{{ #vardefine: delimiter | {{
#vardefine: delimiter | {{
  #switch: {{{delimiter|}}}
#switch: {{{delimiter|}}}
  | , | pretty = , 
| , = , 
  | and =  and 
| and =  and 
  | & =  & 
| & =  & 
  | or =  or 
| or =  or 
  | newline = <br/>
| newline = <br/>
  | list | list-newline | bullet | * = <br/>
| list | list-newline | bullet | * = <br/>
{{{list-level|**}}}
{{{list-level|**}}}
| none = <nowiki/>
  | none = <nowiki/>
| #default = {{{delimiter|&nbsp;}}}
  | #default = {{{delimiter|&nbsp;}}}
}}
  }}
}}<code>{{{1}}}</code>{{#if: {{{2|}}} | {{#var: delimiter
}}{{ #vardefine: finaldelimiter | {{ #ifeq: {{{delimiter}}} | pretty | ,&nbsp;and&nbsp; | {{ #var: delimiter }} }}
}}<code>{{{2|}}}</code>}}{{#if: {{{3|}}} | {{#var: delimiter
}}<code>{{{1}}}</code>{{ #if: {{{2|}}} | {{ #var: {{ #if: {{{3|}}} || final }}delimiter }}<code>{{{2}}}</code>
}}<code>{{{3|}}}</code>}}{{#if: {{{4|}}} | {{#var: delimiter
}}{{ #if: {{{3|}}} | {{ #var: {{ #if: {{{4|}}} || final }}delimiter }}<code>{{{3}}}</code>
}}<code>{{{4|}}}</code>}}{{#if: {{{5|}}} | {{#var: delimiter
}}{{ #if: {{{4|}}} | {{ #var: {{ #if: {{{5|}}} || final }}delimiter }}<code>{{{4}}}</code>
}}<code>{{{5|}}}</code>}}{{#if: {{{6|}}} | {{#var: delimiter
}}{{ #if: {{{5|}}} | {{ #var: {{ #if: {{{6|}}} || final }}delimiter }}<code>{{{5}}}</code>
}}<code>{{{6|}}}</code>}}{{#if: {{{7|}}} | {{#var: delimiter
}}{{ #if: {{{6|}}} | {{ #var: {{ #if: {{{7|}}} || final }}delimiter }}<code>{{{6}}}</code>
}}<code>{{{7|}}}</code>}}{{#if: {{{8|}}} | {{#var: delimiter
}}{{ #if: {{{7|}}} | {{ #var: {{ #if: {{{8|}}} || final }}delimiter }}<code>{{{7}}}</code>
}}<code>{{{8|}}}</code>}}{{#if: {{{9|}}} | {{#var: delimiter
}}{{ #if: {{{8|}}} | {{ #var: {{ #if: {{{9|}}} || final }}delimiter }}<code>{{{8}}}</code>
}}<code>{{{9|}}}</code>}}{{#if:{{{10|}}}| {{#var: delimiter
}}{{ #if: {{{9|}}} | {{ #var: {{ #if: {{{10|}}} || final }}delimiter }}<code>{{{9}}}</code>
}}<code>{{{10|}}}</code>}}<noinclude>
}}{{ #if: {{{10|}}} | {{ #var: finaldelimiter }}<code>{{{10}}}</code>
}}<noinclude>
{{shortcut|cd}}
{{shortcut|cd}}
{{documentation}}
{{documentation}}
<!-- Put categories/interwiki on the documentation page -->
<!-- Put categories/interwiki on the documentation page -->
</noinclude>
</noinclude>

Revision as of 00:27, 14 November 2018

{{{1}}} Template:Shortcut

[create] [refresh]Documentation
This template has no documentation. If you know how to use this template, please create it.