Template:Code/doc: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
(Created page with "{{doc/start}} To be used if you want to list some short code, which you want to stand out. Similar to using <nowiki><code></code></nowiki> tags, except that it has a grey back...")
 
imported>FrozenPlum
m (Put back what's missing)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{doc/start}}
<!-- Documentation here -->
To be used if you want to list some short code, which you want to stand out. Similar to using <nowiki><code></code></nowiki> tags, except that it has a grey background.
To be used if you want to list some short code, which you would like to stand out. Similar to using <nowiki><code></code></nowiki> tags, except that it has a grey background.


== Usage ==
== Usage ==
Use {{tl|code|Code to display}}, which results in {{code|Code to display}}.
Use <code><nowiki>{{code|Code to display}}</nowiki></code>, which results in {{code|Code to display}}.


; Unnamed parameter 1
; Unnamed parameter 1
Line 9: Line 10:


; class=
; class=
Css class(es).
CSS class(es).


; id=
; id=
Line 18: Line 19:


== Examples ==
== Examples ==
{{tl|code|lang{{=}}css|border:1px solid #fff}} => results in {{code|lang=css|border:1px solid #fff}}
<code><nowiki>{{code|code|lang{{=}}css|border:1px solid #fff}}</nowiki></code> => results in {{code|lang=css|border:1px solid #fff}}



Note: Template based off [[wikipedia:Template:Code]] and [[mw:Template:Code]]
Note: Template based off [[wikipedia:Template:Code]] and [[mw:Template:Code]]

{{doc/end}}
<includeonly>
<!-- Template categories/interwikis here -->
[[Category:Templates]]
[[Category:Formatting templates]]
</includeonly>

Latest revision as of 22:41, 29 March 2022

This is the documentation page, it should be transcluded into the main template page. See Template:Documentation for more information

To be used if you want to list some short code, which you would like to stand out. Similar to using <code></code> tags, except that it has a grey background.

Usage

Use {{code|Code to display}}, which results in Code to display.

Unnamed parameter 1

The code to display.

class=

CSS class(es).

id=

Id attribute.

lang=

The language of code.

Examples

{{code|code|lang{{=}}css|border:1px solid #fff}} => results in border:1px solid #fff

Note: Template based off wikipedia:Template:Code and mw:Template:Code