MediaWiki Extension SyntaxHighlight: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 36: Line 36:
==Reduce Font Size==
==Reduce Font Size==


Look up page MediaWiki:Common.css, or create if it does not exist, and append the following sequence:
Look up page [[Media_Wiki_Concepts#MediaWiki:Common.css|MediaWiki:Common.css]], or create if it does not exist, and append the following sequence:
<syntaxhighlight lang='css'>
<syntaxhighlight lang='css'>
/* CSS placed here will be applied to all skins */
/* CSS placed here will be applied to all skins */

Revision as of 07:50, 7 December 2020

External

Internal

Installation

Download from https://www.mediawiki.org/wiki/Special:ExtensionDistributor/SyntaxHighlight_GeSHi

Expand in /var/www/<mediawiki-dir>/extensions:

tar -xzf SyntaxHighlight_GeSHi-REL1_35-6bd7a93.tar.gz -C /var/www/mediawiki-1.35.0/extensions

Add the following line at the bottom of LocalSettings.php

wfLoadExtension( 'SyntaxHighlight_GeSHi' );

Set execute permissions for the pygmentize binary:

chmod a+x /var/www/<mediawiki-dir>/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize

Install Python 3 (python3 must be available in PATH):

Python Installation

Restart httpd:

systemctl restart httpd

Installation Verification

Navigate to Special pages → Version and ensure the extension was installed.

Configuration

Reduce Font Size

Look up page MediaWiki:Common.css, or create if it does not exist, and append the following sequence:

/* CSS placed here will be applied to all skins */
.mw-highlight pre {
	font-size: 90%;
}