Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Google Code Prettify extension for MediaWiki

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 google-code-prettify
Octocat-spinner-32 GoogleCodePrettify.body.php
Octocat-spinner-32 GoogleCodePrettify.i18n.php
Octocat-spinner-32 GoogleCodePrettify.php
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 init.js
README.md

GoogleCodePrettify

This MediaWiki extension adds syntaxhighlight tag that is implemented using Google Code Prettify library.

Requirements

  • MediaWiki 1.17 or above.

Installation

Clone extension repository to extensions/GoogleCodePrettify directory.

cd $MEDIAWIKI_ROOT
git clone git://github.com/Undev/MediaWiki-GoogleCodePrettify.git extensions/GoogleCodePrettify

Add to LocalSettings.php before trailing ?> this code:

require_once( "$IP/extensions/GoogleCodePrettify/GoogleCodePrettify.php" );

That's all.

syntaxhighlight tag

Google Code Prettify automatically recognizes language of source code. But you can set it using lang attribute.

class attribute

You can add additional CSS class names to generated pre tags using class attribute. This is useful, for example, to add mw-collapsible class.

Configuration

Enable handling of source tag.

Handling of source tag disabled by default and is not recommended.

You can override this behavior by setting global $wgGoogleCodePrettifyAllowSourceTag variable to true.

Enable handling of shl tag.

Handling of shl tag disabled by default.

You can override this behavior by setting global $wgGoogleCodePrettifyAllowShlTag variable to true.

Additional languages

By default GoogleCodePrettify enables core languages plus css, sql and yaml.

You can add or remove supported languages by changing of global $wgGoogleCodePrettifyAdditionalLanguages array variable.

License

Licensed under MIT License.

Links

Something went wrong with that request. Please try again.