Template:Code/doc: Difference between revisions
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 m (Put back what's missing) |
||
(One intermediate revision by the same user 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 |
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 {{ |
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 == |
||
{{ |
<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> |
|||
[[Category:Formatting templates]] |
|||
{{doc/end}} |
|||
</includeonly> |
Latest revision as of 22:41, 29 March 2022
[purge]
This is the documentation page, it should be transcluded into the main template page. See Template:Documentation for more informationTo 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