MediaWiki-Docker/Extension/SyntaxHighlight

From mediawiki.org
Jump to navigation Jump to search

Download the SyntaxHighlight extension into extensions/ and enable it the usual way in LocalSettings.php:

wfLoadExtension( 'SyntaxHighlight_GeSHi' );

You will also need to customize the base MediaWiki image as described in Configuration_recipes/Customize_base_image to install the python3 package, which is relied upon by the extension to perform the syntax highlighting.

In the MediaWiki root directory, create a file called (for example) python3.dockerfile, with the following contents:

FROM docker-registry.wikimedia.org/dev/stretch-php72-fpm:2.0.0
RUN apt update && apt install -y python3

Then update docker-compose.override.yaml to use this dockerfile when building the image for the mediawiki service:

services:
  mediawiki:
    build:
      context: .
      dockerfile: python3.dockerfile

Finally, rebuild the mediawiki service with docker-compose build.