Template:Tj/doc
This is a documentation subpage for Template:Terminate sentence It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This template uses TemplateStyles: |
The {{Template journal}} template allows to showcase with colors and multiple lines the syntax of any template, while providing an easy way to display placeholder texts using colons as separators.
For an identical template that displays the output in horizontal format, see {{Template journal inline}}. See also {{Template journal parameter}} for a template similar to {{para}} that uses the same syntax and produces the same output as the parameters displayed by {{tj}} and {{tji}}.
Usage[edit]
- Syntax
- Template:Tji
For instance, the following code
<syntaxhighlight lang="wikitext">Page Template:Template journal/styles.css has no content.
| last = Author's last name
| first = Author's first name
| author-link = Author's page name on Wikipedia
| date = Publication date
| title = Work's title
| url = Work's URL
| location = Where the work was published
| publisher = Name of the publisher
}}
</syntaxhighlight>
will produce the following result.
Page Template:Template journal/styles.css has no content.
| last = Author's last name
| first = Author's first name
| author-link = Author's page name on Wikipedia
| date = Publication date
| title = Work's title
| url = Work's URL
| location = Where the work was published
| publisher = Name of the publisher
}}
Likewise, the following code
<syntaxhighlight lang="wikitext">Page Template:Template journal/styles.css has no content.
| name =
| image =
| caption =
| character =
| actor =
| writer =
| firstusedin =
| alsousedin =
| moviequotes =
}}
</syntaxhighlight>
will produce the following result.
Page Template:Template journal/styles.css has no content.
| name =
| image =
| caption =
| character =
| actor =
| writer =
| firstusedin =
| alsousedin =
| moviequotes =
}}
And finally, the following code
<syntaxhighlight lang="wikitext">Page Template:Template journal/styles.css has no content.
| Cry "Havoc" and let slip the dogs of war.
| [[William Shakespeare]]
| character = Mark Antony
| title = ''[[Julius Caesar (play)|Julius Caesar]]''
| source = act III, scene I
}}
</syntaxhighlight>
will produce the following result.
Page Template:Template journal/styles.css has no content.
| Cry "Havoc" and let slip the dogs of war.
| [[William Shakespeare]]
| character = Mark Antony
| title = ''[[Julius Caesar (play)|Julius Caesar]]''
| source = act III, scene I
}}
Edge cases[edit]
To preserve one or more initial colons from being replaced, the :
HTML entity must be used. After one colon has been replaced all other colons in the argument will be preserved.
Similarly, to insert one or more equals signs into a parameter content, either {{=}}
or =
must be used.
Thus, the following are all valid parameters,
<syntaxhighlight lang="wikitext">
Page Template:Template journal/styles.css has no content.
| Hello
| World
| foo = bar
|
| road =
| keep:the:colon = I:said:keep:it!
| ink = marble
| book = /books?id=mAlLt1aGsWYC
}}
</syntaxhighlight>
and they will produce the following result.
Page Template:Template journal/styles.css has no content.
| Hello
| World
| foo = bar
|
| road =
| keep:the:colon = I:said:keep:it!
| ink = marble
| book = /books?id=mAlLt1aGsWYC
}}
Arguments containing one or more unescaped equals signs will be silently ignored. Thus, the following code
<syntaxhighlight lang="wikitext">
Page Template:Template journal/styles.css has no content.
</syntaxhighlight>
will produce the following problematic result.
Page Template:Template journal/styles.css has no content.
Instead, the right way to write the previous unlikely example is the following,
<syntaxhighlight lang="wikitext">
Page Template:Template journal/styles.css has no content.
</syntaxhighlight>
which will correctly print
Page Template:Template journal/styles.css has no content.
By design, there is no way to deviate from the format of one argument per line (vertical format). If you need to display a template and all its arguments in one single line (horizontal format), please refer to {{tji}}. If you need a more irregular output, please refer to other solutions.
Before editing this template[edit]
- Do not add optional arguments for offering customized results (e.g. changing colors on demand, font, etc.): one of the purposes of this template is that of maintaining always the same look across the entire Wikipedia concerning how templates are shown and explained
- If you intend to introduce substantial changes that are not simple bug fixes, you are invited to discuss them in the talk page first
- If you do make changes, please make always sure that the {{tji}} template remains consistent with this template
Subpages[edit]
- {{Template journal/arg}} – no longer used, will be removed at some point
- Template:Rel
See also[edit]
- {{Template journal inline}}
- {{Template journal parameter}}
- {{Template link}}
- {{Template link expanded}}
{{Syntaxhighlight|lang=wikitext}}
<syntaxhighlight lang="wikitext">...</syntaxhighlight>