Extension:SyntaxHighlightPages

Category:Unmaintained extensions#SyntaxHighlightPages Category:Extensions without an imageCategory:MIT licensed extensions
MediaWiki extensions manual
SyntaxHighlightPages
Release status: unmaintainedCategory:Unmaintained extensions
Implementation ContentHandler Category:ContentHandler extensions
Description Syntax highlight pages based on title suffixes.
Author(s) (Gittenburgtalk)
Latest version 0.1.0 (2019-07-13)
Compatibility policy Master maintains backward compatibility.Category:Extensions with master compatibility policy
MediaWiki 1.31+Category:Extensions with manual MediaWiki version
License MIT License
Download Category:Extensions in GitHub version control
$wgSyntaxHighlightPagesSuffixes
Category:All extensionsCategory:Extensions not in ExtensionJson

The SyntaxHighlightPages extension highlights pages based on title suffixes; it depends on Extension:SyntaxHighlight.

Additionally the extension adds a Download link to the toolbox on highlighted pages.

Installation

  • Download and place the file(s) in a directory called SyntaxHighlightPages in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'SyntaxHighlightPages' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parameters

$wgSyntaxHighlightPagesSuffixes
The enabled suffixes.

For example:

$wgSyntaxHighlightPagesSuffixes = ['txt', 'html', 'css', 'xml', 'js', 'php'];

Note that the suffix needs to be a short name listed under https://pygments.org/docs/lexers/.

Unfortunately using the file extensions known to Pygments does not work since Extension:SyntaxHighlight provides no PHP wrapper for pygments.lexers.find_lexer_class_for_filename.

This does mean that adding e.g. 'htm' will not work because it is not a lexer name.

Category:Simple extensions Category:Extensions with SyntaxHighlight support
Category:All extensions Category:BaseTemplateToolbox extensions Category:ContentHandlerDefaultModelFor extensions Category:ContentHandler extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions with SyntaxHighlight support Category:Extensions with manual MediaWiki version Category:Extensions with master compatibility policy Category:Extensions without an image Category:MIT licensed extensions Category:Simple extensions Category:Unmaintained extensions