Template:Code/doc: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
m (2 revisions imported: Imported from help.fandom.com, Extension:DPL3 pages, which are for the obsolete version of DPL3 extension for MediaWiki 1.33, to adapt to forked (newer) extension version.)
imported>FrozenPlum
mNo edit summary
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 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]]


<includeonly>
<noinclude>
<!-- Template categories/interwikis here -->
[[tr:Şablon:Kod/belge]]
[[Category:Templates]]
</noinclude>
</includeonly>
{{doc/end}}

Revision as of 02:36, 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