Jump to content

Template:Code

From DynamicPageList4 Manual
Template documentation
Note: portions of the template sample may not be visible without values provided.
View or edit this template's documentation (edit) (about template documentation).
No TemplateStyles exist (create). Remember to add after the opening <includeonly> tag:
<templatestyles src="Template:Code/styles.css" />

Note: Template based off wikipedia:Template:Code and mw:Template:Code Use {{code|Code to display}}, which results in Code to display.

Example(s) and usage

[edit source]

{{code|code|lang{{=}}css|border:1px solid #fff}} gives: border:1px solid #fff

Template Data

[edit source]

Wraps the content given in {{#tag:syntaxhighlight}} with the enclose="none" attribute and other attributes specified. Used to list some short code, which to stand out, similar to using <nowiki><code></code></nowiki> tags, except that it has a grey background.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
11

Enter the code to display.

Stringrequired
22 lang text

Enter the language of the code.

Default
text
Stringoptional
classclass

Enter valid CSS class(es).

Default
code
Stringoptional
stylestyle

Enter any valid CSS styles, or a string of them separated by semicolons.

Stringoptional
idid

Enter a valid CSS ID attribute.

Stringoptional


Cookies help us deliver our services. By using our services, you agree to our use of cookies.