Template:M/doc: Difference between revisions

From AniDB
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
==Syntax==
==Syntax==
The template can have '''1''' to '''11 parameters''':
The template can have '''1''' to '''11 parameters''':
#{{m|m{{!}}<template>}} - Template name.
#{{m|m|<template>}} - Template name.
#{{m|m{{!}}<template>{{!}}<parameter1>}} - Template name with 1 parameter.
#{{m|m|<template>|<parameter1>}} - Template name with 1 parameter.
#{{m|m{{!}}<template>{{!}}<p1>{{!}}<p2>}} - Template name with 2 parameters.
#{{m|m|<template>|<p1>|<p2>}} - Template name with 2 parameters.
# ...
# ...
#{{m|m{{!}}<template>{{!}}<p1>{{!}}<p2>{{!}} ... {{!}}<p10>}} - Template name with 10 parameters.
#{{m|m|<template>|<p1>|<p2>| ... |<p10>}} - Template name with 10 parameters.


   '''<template>'''  =  The template name you want to see in bold, with true type font.
   '''<template>'''  =  The template name you want to see in bold, with true type font.
Line 28: Line 28:
{{m|delete|<reason>}}
{{m|delete|<reason>}}


  <nowiki>{{m|<#>|<info>|<text>}}</nowiki>
  <nowiki>{{m|eyecatch|<#>|<info>|<text>}}</nowiki>
{{m|<#>|<info>|<text>}}
{{m|eyecatch|<#>|<info>|<text>}}


  <nowiki>{{m|quote|<#>|<user>|<quote>|<source>}}</nowiki>
  <nowiki>{{m|quote|<#>|<user>|<quote>|<source>}}</nowiki>
{{m|quote|<#>|<user>|<quote>|<source>}}
{{m|quote|<#>|<user>|<quote>|<source>}}


{{eyecatch|Hint|The more observant wiki coder will notice that using <nowiki>|</nowiki> as an string character in <template>, e.g. <nowiki>delete|<reason></nowiki> is actually not allowed, but since the code interprets the additional columns as actual parameters, things work out fine.}}
{{eyecatch|Hint|The more observant wiki coder will notice that using <nowiki>|</nowiki> as a string character in <template>, e.g. <nowiki>delete|<reason></nowiki> is actually not allowed, but since the code interprets the additional <nowiki>|</nowiki> delimited columns as actual parameters, things work just fine.}}

Latest revision as of 22:43, 6 May 2009

Convenient shortcut of presenting "text" in bold with true type font, plus citing it literally, i.e. not interpreting it.

Note The text is prefixed with {{, and }} is appended!

Syntax

The template can have 1 to 11 parameters:

  1. {{m|<template>}} - Template name.
  2. {{m|<template>|<parameter1>}} - Template name with 1 parameter.
  3. {{m|<template>|<p1>|<p2>}} - Template name with 2 parameters.
  4. ...
  5. {{m|<template>|<p1>|<p2>| ...|<p10>}} - Template name with 10 parameters.
  <template>  =  The template name you want to see in bold, with true type font.

<parameter1>  = 1st template parameter name.
        <p2>  = 2nd template parameter name.
        ...
        <p10>  = 10th and last template parameter name.
Resulting source code: '''<tt><nowiki>{{<template>}}</nowiki></tt>'''

Real-world Examples

{{m|message}}

{{message}}

{{m|delete|<reason>}}

{{delete|<reason>}}

{{m|eyecatch|<#>|<info>|<text>}}

{{eyecatch|<#>|<info>|<text>}}

{{m|quote|<#>|<user>|<quote>|<source>}}

{{quote|<#>|<user>|<quote>|<source>}}

Hint The more observant wiki coder will notice that using | as a string character in <template>, e.g. delete|<reason> is actually not allowed, but since the code interprets the additional | delimited columns as actual parameters, things work just fine.