Jump to content
Wikipedia The Free Encyclopedia

Template:Template journal

From Wikipedia, the free encyclopedia
(Redirected from Template:Tj)
Template documentation[view] [edit] [history] [purge]
This template uses Lua:

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
{{tj |template|param. name 1: param. content 1|param. name 2: param. content 2...}}

For instance, the following code

{{tj|cite book
 |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}}

will produce the following result.

{{cite book
| 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

{{tj|Infobox movie quote|name:|image:|caption:|character:|actor:|writer:
 |firstusedin:|alsousedin:|moviequotes:}}

will produce the following result.

{{Infobox movie quote
| name =
| image =
| caption =
| character =
| actor =
| writer =
| firstusedin =
| alsousedin =
| moviequotes =
}}

And finally, the following code

{{tj|Blockquote
 | Cry "Havoc" and let slip the dogs of war.
 | <nowiki>[[William Shakespeare]]</nowiki>
 | character: Mark Antony
 | title: <nowiki>''[[Julius Caesar (play)|Julius Caesar]]''</nowiki>
 | source: act III, scene I
}}

will produce the following result.

{{Blockquote
| 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 &#58; 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 &#61; must be used.

Thus, the following are all valid parameters,

<!-- Good example -->
{{tj|Some template
 | Hello
 | World
 | foo: bar
 |
 | road:
 | keep&#58;the&#58;colon:I:said:keep:it!
 | ink :marble
 | book: /books?id{{=}}mAlLt1aGsWYC
}}

and they will produce the following result.

{{Some template
| 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

<!-- Bad example -->
{{tj|Some template
 | Hello
 | this = will = be = ignored
 | road: unknown
}}

will produce the following problematic result.

{{Some template
| Hello
| road = unknown
}}

Instead, the right way to write the previous unlikely example is the following,

<!-- Good example -->
{{tj|Some template
 | Hello
 | this {{=}} will {{=}} not {{=}} be {{=}} ignored
 | road: unknown
}}

which will correctly print

{{Some template
| Hello
| this = will = not = be = ignored
| road = unknown
}}

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
  • ./styles.css

See also

[edit ]
Template  Example output  Use 
{{strong }} Important! To indicate <strong> importance, seriousness, or urgency instead of just simple typographical boldfacing
{{strongbad }} "Never use ..." Same as {{strong}} but in red
{{stronggood }} "Only use ..." Same as {{strong}} but in green
{{em }} "An emphatic phrase" To indicate <em> stress emphasis (not just purely typographical italicization like for book titles or foreign terms)
{{var }} strPrefix To indicate text is a variable name. Use for any variable names except those including "I" (uppercase i) and/or "l" (lowercase L); for these, {{var serif}} should be used to ensure a noticeable distinction
{{var serif }} strIllustratePrefix (see {{var}} above)
{{tld }} {{DEFAULTSORT:Y, X}} To display wikicode variables and magic words as they would appear in code
{{para }} |year=2008 To display template parameters with or without values
{{param }} {{{title|alt}}} To display parameters as used in code (i.e. with triple braces), especially to indicate relationships between them. May be combined with {{para}} above
{{tjp }} selfref=yes To display template parameters with colors (as they would appear in the {{tj }} and {{tji }} templates)
{{param value }} ··2·blanks·fore·and·aft·· To display parameter values lightly bordered; replaces <code>...</code>, especially when value contains embedded or leading/trailing blanks; visualized here with middot (·) but can use ␠, ▯, or any character.
{{tlx }} etc. {{Template|1|2|...|10}} To display a template call (with or without parameters and values) as code
{{tji }} {{hatnote |Hello|selfref=yes|category=no}} To showcase with colors in horizontal format the syntax of any template, while providing an easy way to display placeholder texts using colons as separators
{{tag }} "The <img>...</img> tags ..." To render HTML elements ("tags") in prose
{{code }}/{{codett }} "Ensure the alt= parameter ..." To indicate text is source code. To nest other templates within {{code}}, use <code>...</code>. {{codett }} differs only in styling: someMethod becomes someMethod
{{PreCode }} "FORTH has keyword ?BRANCH." Like {{code }}, but prevents line breaks inside the code. Only for very short code parts.
{{subst:codenowiki}} {{small|small text example}} To wrap example code in <code><nowiki>...</nowiki></code>
{{subst:kbdnowiki}} {{large|large text example}} To wrap example code in <kbd><nowiki>...</nowiki></kbd>
{{syntaxhighlight }}     [this is a block template] ( or {{sxhl}})  Wrapper for <syntaxhighlight>...</syntaxhighlight>, but will wrap overflowing text
{{deprecated code }} "Do not use <(削除) blink (削除ここまで)>." ( or {{dc}})  To indicate deprecated source code in template documentation, articles on HTML specs, etc. The {{dc2}} variant uses strike-through (<(削除) blink (削除ここまで)>) while {{dcr}} uses red (<(削除) blink (削除ここまで)>).
{{pre }}     [this is a block template] For larger blocks of source code and other pre-formatted text
{{tj }}     [this is a block template] To showcase with colors and multiple lines (vertical format) the syntax of any template, while providing an easy way to display placeholder texts using colons as separators
{{quote }}     [this is a block template] For block quotations (only – never for non-quotations)
{{block indent }}     [this is a block template] For indented blocks of material; visually identical to {{quote}} but without quote markup
{{kbd }} user input To indicate user input
{{key press }} Ctrl+x To indicate specific-keystroke input, including combinations
{{key top }} Left shift Similar; includes more symbols, but does not directly support combinations
{{button }} Don't save To indicate a button in a user interface
{{samp }} example output To indicate sample or example output
The above documentation is transcluded from Template:Template journal/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.

AltStyle によって変換されたページ (->オリジナル) /