Template:Command

From ParabolaWiki
Jump to: navigation, search
This page is a template. It contains no Parabola-related information, but should be used as part of other articles. For more information, read Help:Template.

Please do not experiment with this template; you could ruin all pages using this template. If you want to edit this template, copy the text to Template:Sandbox, edit and test it there, and copy it back when it works.

Feel free to voice your opinion regarding this template.

A 'Command' box used to display command output.

This template accepts both named and unnamed parameters.

{{Command|name=command name|output=command output}}
$ command name

<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">command output</pre<noinclude></noinclude>>

{{Command|command=command name|output=command output}}
$ command name

<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">command output</pre<noinclude></noinclude>>

{{Command|command name|command output}}
$ command name

<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">command output</pre<noinclude></noinclude>>

An optional prompt argument can be used to specify an alternative prompt. The default prompt is $, indicating that the command should be run as an unprivileged user. To specify that a command should be run as root, use # as the prompt:

{{Command|privileged command name|privileged command output|prompt=#}}
# privileged command name

<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">privileged command output</pre<noinclude></noinclude>>

This template can be used for any interactive shell. For example, an interactive Python session:

{{Command|import this|The Zen of Python, by Tim Peters|prompt=>>>}}
>>> import this

<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">The Zen of Python, by Tim Peters</pre<noinclude></noinclude>>

Note that parameters containing equals signs and wiki markup should be surrounded by <nowiki> tags, like so:

{{Command|command name|<nowiki>command output with [[wiki markup]] and '''such'''<nowiki>}}
$ command name

<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">command output with [[wiki markup]] and '''such'''</pre<noinclude></noinclude>>

Otherwise, the markup will be parsed by MediaWiki. (This may, in fact, be the desired result.)

{{Command|command name|command output with [[wiki markup]] and '''such'''}}
$ command name

<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">command output with wiki markup and such</pre<noinclude></noinclude>>

Long lines will automatically wrap.

{{Command|{{Lorem Ipsum}}|{{Lorem Ipsum}}}}
$ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin egestas, magna non sollicitudin commodo, sapien elit semper sapien, adipiscing consectetur nisi ipsum ut elit. Sed ac neque ut nulla tempor porttitor. Mauris interdum. Cras feugiat sodales nibh. Proin neque turpis.

<pre<noinclude></noinclude> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin egestas, magna non sollicitudin commodo, sapien elit semper sapien, adipiscing consectetur nisi ipsum ut elit. Sed ac neque ut nulla tempor porttitor. Mauris interdum. Cras feugiat sodales nibh. Proin neque turpis.</pre<noinclude></noinclude>>