Difference between revisions of "Template:Code"

From EVE University Wiki
Jump to: navigation, search
Line 10: Line 10:
 
This code:
 
This code:
  
{{co|yellow|<nowiki>{{ code | {{ foo | bar }}}}</nowiki>}}
+
{{co|yellow|<nowiki>{{ code | <nowiki> {{ foo | bar }} </nowiki></nowiki><nowiki> }}</nowiki>}}
  
 
Would result in this:
 
Would result in this:

Revision as of 13:37, 28 November 2013

Contents

Just a little something to be able to use pre-formatted text within the confined of a code-like presentation without the box taking up the entire width of the page.

Usage

It's a simple template, you just add the code or function name you wish to present as the second argument:

  • {{ code | text }}

Example

This code:

{{ code | <nowiki> {{ foo | bar }} </nowiki> }}

Would result in this:

{{ foo | bar }}

And this code:

{{code|Foo
bar
  Hah!}}

Would result in this:

Foo

bar

Hah!

Similarly this code:

{{code|10 PRINT "Hello World!"
20 END}}

Would result in this:

10 PRINT "Hello World!" 20 END

Using it inline, like this:

foo {{code|Foo what? Huh? Huh!}} bar

Would result in this:

Foo

Foo what? Huh? Huh!

bar

This as opposed to how <pre></pre> tags usually work:

Go ahead, use all the width :(