Jump to content

Template:Inline-code

Permanently protected template
From mediawiki.org

{{{1}}}

Template documentation

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[Edit template data]

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