Šablona:Code/doc

Z Wiki JU
Verze z 20. 5. 2023, 15:40, kterou vytvořil Template code>Waldyrious (See also: +2)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)

[[Category:MediaWiki documentation pages{{#translation:}}]]

Usage

This is a semantic markup wrapper template for the HTML element ‎<code>...‎</code>. It can be used without a parameter to wrap code in a formatted block, with syntax highlighting, or with |inline= for a leaner presentation.

Example:

{{code|lang=css|font-family: 'Times New Roman', serif;}}

produces:

font-family: 'Times New Roman', serif;

Inline:

{{code|inline=y|lang=css|font-family: 'Times New Roman', serif;}}

produces:

font-family: 'Times New Roman', serif;

and is equivalent to:

<syntaxhighlight inline lang="css">font-family: 'Times New Roman', serif;</syntaxhighlight>

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Code

[[Category:TemplateData documentation{{#translation:}}]]

A block or inline source code string.

Parametry šablony

Tato šablona upřednostňuje parametry formátované v bloku.

ParametrPopisTypStav
Languagelang 2

The programming language of the source code. List of valid values is at: Extension:SyntaxHighlight#Supported_languages

Výchozí hodnota
  • text (if `inline=true`)
  • bash (if `inline` is not set)
Řetězecdoporučený
Inline?inline

Whether to use inline formatting

Automatická hodnota
1
Řetězecnepovinný
Classclass

Applies only if `inline=true`

Řetězecnepovinný
IDid

Applies only if `inline=true`

Řetězecnepovinný
CSS Stylestyle

Applies only if `inline=true`

Řetězecnepovinný
Headerheader

Applies only if `inline` is not set

Řádkanepovinný
Code1 code

The code to display.

Řetězecpovinný

See also