Extension:SyntaxHighlight vim

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
SyntaxHighlight_vim

Release status: beta

Implementation Tag
Description Syntax highlighting of text within <syntax> tags, with the use of vim
Author(s) Ævar Arnfjörð Bjarmasontalk
MediaWiki 1.6
License No license specified
Download
Check usage and version matrix

Contents

What can this extension do? [edit]

This extension adds the `syntax' tag to present formatted source code.

Usage [edit]

On the wiki page, you can now use `syntax' elements:

<syntax>
<?php
    v = "string";    // sample initialization
?>
html text
<?
    echo v;         // end of php code
?>
</syntax>

Download instructions [edit]

Download the extension from the Subversion repository and save it into the extensions\SyntaxHighlight_vim of your wiki. If you have shell access to your server, you may do the following to download the extension:

cd extensions
svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SyntaxHighlight_vim

Installation [edit]

  • Add this line to your LocalSettings.php right before $wgSitename:
require_once("extensions/SyntaxHighlight_vim/SyntaxHook.php");
  • Open file extensions/SyntaxHighlight_vim/SyntaxHook.php and add below line at the beginning
require_once("Syntax.php");
  • Make sure that your server has vim binary available. For example on CentOS do
yum install vim-common
yum install vim-enhanced

See also [edit]

Extension:SyntaxHighlight GeSHi