MediaWiki master
MediaWiki\Content\CodeHighlighterOptions Class Reference

Public Member Functions

 __construct (public string $language, public array $classes=[], public string $dir='ltr', public bool $inline=false, public bool $includeLineNumbers=false, public int $startingLineNumber=1, public bool $includeLineLinks=false, public string $linkLinkAnchorPrefix='L', public string $highlightLines='', public bool $isCopiable=false)
 

Detailed Description

Stability: newable
Since
1.47

Definition at line 10 of file CodeHighlighterOptions.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Content\CodeHighlighterOptions::__construct ( public string $language,
public array $classes = [],
public string $dir = 'ltr',
public bool $inline = false,
public bool $includeLineNumbers = false,
public int $startingLineNumber = 1,
public bool $includeLineLinks = false,
public string $linkLinkAnchorPrefix = 'L',
public string $highlightLines = '',
public bool $isCopiable = false )
Parameters
string$languageLanguage code
string[]$classesClasses to apply to the output HTML element
string$dirHTML dir attribute to apply to the output HTML element
bool$inlineWhether the code block should be rendered inline with text
bool$includeLineNumbersWhether the code block should include line numbers
int$startingLineNumberLine number for the first line of the code block
bool$includeLineLinksWhether the line numbers should have links
string$linkLinkAnchorPrefixPrefix for the anchor for each line number (if $includeLineLinks is enabled)
string$highlightLinesComma-separated list of line numbers and line number-ranges to be highlighted
bool$isCopiableWhether a button should be shown for copying the code to the clipboard

Definition at line 24 of file CodeHighlighterOptions.php.


The documentation for this class was generated from the following file: