Template:Out: Difference between revisions
Content added Content deleted
m (tinkering) |
(add two optional parameters "in" and "comment", and properly document the template) |
||
Line 1: | Line 1: | ||
<includeonly><div> |
<includeonly><div> |
||
;{{#if: {{{1|}}} | {{{1}}} | Output}}< |
;{{#if: {{{1|}}} | {{{1}}} | Output}}{{#if: {{{comment|}}}{{{in|}}} | <span style="font-weight:normal> — {{#if: {{{comment|}}} | {{{comment|}}} | when given an input of <code>{{{in|}}}</code>}}</span> |}}<nowiki>:</nowiki></div></includeonly><noinclude> |
||
This template is used to |
This template is used to introduce the example output of a programming example. |
||
===Usage=== |
|||
Write <code><nowiki>{{out}}</nowiki></code> just above the <code><nowiki><pre>...</pre></nowiki></code> block that lists a code example's output. |
|||
It also accepts these optional parameters: |
|||
{| class="wikitable" |
|||
|- |
|||
! Parameter |
|||
! Purpose |
|||
! Example |
|||
! Renders as |
|||
|- |
|||
| |
|||
| |
|||
| <code><nowiki>{{out}}</nowiki></code> |
|||
| {{out}} |
|||
|- |
|||
| <code>1</code> |
|||
| Replaces the word "Output". |
|||
| <code><nowiki>{{out|Return value}}</nowiki></code> |
|||
| {{out|Return value}} |
|||
|- |
|||
| <code>in</code> |
|||
| The (single-line) input which produces this output. |
|||
| <code><nowiki>{{out|in=Hello world}}</nowiki></code> |
|||
| {{out|in=Hello world}} |
|||
|- |
|||
| <code>comment</code> |
|||
| Any other text you want shown in the same line. |
|||
| <code><nowiki>{{out|comment=test case 1}}}}</nowiki></code> |
|||
| <div style="white-space:nowrap">{{out|comment=test case 1}}</div> |
|||
|} |
|||
{{template}}</noinclude> |
Revision as of 06:53, 25 August 2016
This template is used to introduce the example output of a programming example.
Usage
Write {{out}}
just above the <pre>...</pre>
block that lists a code example's output.
It also accepts these optional parameters:
Parameter | Purpose | Example | Renders as |
---|---|---|---|
{{out}}
|
| ||
1
|
Replaces the word "Output". | {{out|Return value}}
|
|
in
|
The (single-line) input which produces this output. | {{out|in=Hello world}}
|
|
comment
|
Any other text you want shown in the same line. | {{out|comment=test case 1}}}}
|
|