MediaWiki master
MediaWiki\Content\CodeHighlighterMetadata Class Reference

Default metadata implementation for highlighted code. More...

Inherits MediaWiki\Content\ICodeHighlighterMetadata.

Collaboration diagram for MediaWiki\Content\CodeHighlighterMetadata:

Public Member Functions

 __construct (protected array $modules=[], protected array $moduleStyles=[], protected array $categories=[], protected array $warnings=[],)
 
 addToOutputPage (OutputPage $outputPage)
 Add this metadata to an OutputPage.
 
 addToParserOutput (ParserOutput $parserOutput)
 Add this metadata to a ParserOutput.
 

Detailed Description

Default metadata implementation for highlighted code.

Providers can use this class directly, or extend it when they need to carry additional metadata without changing CodeHighlighter callers.

Stability: newable
Stability: stable
to extend
Since
1.47

Definition at line 20 of file CodeHighlighterMetadata.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Content\CodeHighlighterMetadata::__construct ( protected array $modules = [],
protected array $moduleStyles = [],
protected array $categories = [],
protected array $warnings = [] )
Parameters
string[]$modulesResourceLoader modules necessary to render the highlighted code
string[]$moduleStylesResourceLoader style modules necessary to render the highlighted code
string[]$categoriesAny tracking categories to be added to the output
MessageSpecifier[]$warningsAny warnings from syntax highlighting

Definition at line 28 of file CodeHighlighterMetadata.php.

Member Function Documentation

◆ addToOutputPage()

MediaWiki\Content\CodeHighlighterMetadata::addToOutputPage ( OutputPage $outputPage)

Add this metadata to an OutputPage.

Parameters
OutputPage$outputPage

Implements MediaWiki\Content\ICodeHighlighterMetadata.

Definition at line 47 of file CodeHighlighterMetadata.php.

◆ addToParserOutput()

MediaWiki\Content\CodeHighlighterMetadata::addToParserOutput ( ParserOutput $parserOutput)

Add this metadata to a ParserOutput.

Parameters
ParserOutput$parserOutput

Implements MediaWiki\Content\ICodeHighlighterMetadata.

Definition at line 36 of file CodeHighlighterMetadata.php.

References MediaWiki\Parser\ParserOutput\addCategory().


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