Jump to content

Template:Inline-code/doc

From wikiNonStop
Revision as of 14:54, 3 April 2026 by en>Tactica (Fix lint warnings; expand, add another category and make categories translation aware.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Usage

This template wraps code in <syntaxhighlight inline lang="{{{lang}}}">{{{code}}}</syntaxhighlight>

where lang defaults to php, but can be any language listed under Extension:SyntaxHighlight § Supported languages.

Example

Some text, then {{Inline-code | 1=wfDebug( $text, $dest = 'all' );}} and more text.

produces

Some text, then wfDebug( $text, $dest = 'all' ); and more text.

Note that for PHP, using the {{phpi}} wrapper might be easier.

TemplateData

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

Inline-code

Applies syntax highlighting to an inline piece of source code.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Code1 code

The code to display.

Stringrequired
Language2 lang

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

Default
php
Example
sql
Stringsuggested
Classclass

Adds one or more CSS classes, separated by a blank

Stringoptional
IDid

Adds an HTML id (must be unique in the page)

Stringoptional
CSS stylestyle

Additional CSS to apply to the output

Example
font-size:120%
Stringoptional
No wrapnowrap

Prevent the output from wrapping.

Default
no
Booleanoptional

Wrappers

See also