Template:Out: Difference between revisions

From Rosetta Code
Content added Content deleted
m (formatting)
m (typo)
 
Line 44: Line 44:
| <code>text</code>
| <code>text</code>
| Free-form text to follow instead of a colon.
| Free-form text to follow instead of a colon.
| <code><nowiki>{{out|text=...}}}}</nowiki></code>
| <code><nowiki>{{out|text=...}}</nowiki></code>
| <div style="white-space:nowrap">{{out|text=...}}</div>
| <div style="white-space:nowrap">{{out|text=...}}</div>
|}
|}

Latest revision as of 10:34, 27 August 2016


This template is used to introduce the 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}}
Output:
1 Text to show instead of the word "Output". {{out|Return value}}
Return value:
case The test-case/condition which produces this output. {{out|case=test case 3}}
Output  —  test case 3:
input The (single-line) input which produces this output. {{out|input=Hello world}}
Output  —  for input Hello world:
note A remark to show in parentheses. {{out|note=elided}}
Output (elided):
text Free-form text to follow instead of a colon. {{out|text=...}}
Output ...

You can combine multiple parameters, except that case and input are mutually exclusive.



This is a template. There are many others. See Category:RCTemplates for a complete list of templates.