Template:MdCode/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:
This template will allow you to format text as a one-line code in Markdown style.
This template will allow you to format text as a one-line code in Markdown style.


== Usage ==
== Parameters ==
Just insert {{MdCode|outline-oneclick|<nowiki>{{MdCode|YourText}}</nowiki>}} into the page and replace '''YourText''' with your content to make the one-line code styling work.
 
<br>'''Manage Wiki Formatting:'''<br>
You can use {{MdCode|outline-oneclick|<nowiki><nowiki>YourText</nowiki></nowiki>}} to disable processing of various commands that allow the wiki to style your text. Also, it can disable the template style.
 
<br>'''Switching Styles:'''<br>
Insert {{MdCode|outline-oneclick|<nowiki>style|</nowiki>}} after {{MdCode|outline-oneclick|<nowiki>{{MdCode|</nowiki>}} and replace '''"style"''' with the name of an existing style.
 
<br>'''Using Modifiers:'''<br>
Insert {{MdCode|outline-oneclick|<nowiki>modifier=YourText|</nowiki>}} after {{MdCode|outline-oneclick|<nowiki>{{MdCode|</nowiki>}} or {{MdCode|outline-oneclick|<nowiki>style|</nowiki>}} and replace '''"modifier"''' with the name of an existing modifier. After the equal sign, you need to write the properties corresponding to the modifier.
 
== Styles ==
{| class="standard-table"
{| class="standard-table"
! Name !! Description
! colspan="2" | Styles
|-
|-
| <code style="padding: 1px 3px;">default</code> || enabled by default, but disabled if other styles are activated
| {{param|desaturated}} || Less saturated version.
|-
|-
| <code style="padding: 1px 3px; user-select: all;">oneclick</code> || default style with one click selection
| {{param|outlined}} || Less saturated version with outline.
|-
| <code style="padding: 1px 3px; user-select: all;">desaturated</code> || less saturated version
|-
| <code style="padding: 1px 3px; user-select: all;">desaturated-oneclick</code> || desaturated style with one click selection
|-
| <code style="padding: 1px 3px; user-select: all;">outline</code> || less saturated version with outline
|-
| <code style="padding: 1px 3px; user-select: all;">outline-oneclick</code> || outline style with one click selection
|}
|}
== Modifiers ==
{| class="standard-table"
{| class="standard-table"
! Name !! Description
! colspan="2" | Modifiers
|-
| {{param|oneclick}} || One-click template content selection.
|-
|-
| <code style="padding: 1px 3px;">background</code> || allows you to change the background color if the default style is enabled
| {{param|color}} || Text color.
|-
|-
| <code style="padding: 1px 3px;">color</code> || allows you to change the color of the text if the default style is enabled
| {{param|background}} || Background color.
|}
|}



Revision as of 02:03, 22 January 2023

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Edit-copy.png
This is a documentation subpage for Template:MdCode.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template will allow you to format text as a one-line code in Markdown style.

Parameters

Styles
{{{desaturated}}} Less saturated version.
{{{outlined}}} Less saturated version with outline.
Modifiers
{{{oneclick}}} One-click template content selection.
{{{color}}} Text color.
{{{background}}} Background color.

Examples

{{MdCode|Go to [[Main Page|Main Page]]}} {{MdCode|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{MdCode|desaturated|Go to [[Main Page|Main Page]]}} {{MdCode|desaturated|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{MdCode|outline|Go to [[Main Page|Main Page]]}} {{MdCode|outline|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx


{{MdCode|oneclick|background=rgb(230,230,230)|color=black|Go to '''[[Main Page|Main Page]]'''}} {{MdCode|background=rgb(40,60,100)|Go to {{hla|4}}}}

Go to Main Page Go to Half-Life: Alyx Half-Life: Alyx