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 Download snapshot
Subversion [Help]

Browse source code
View code changes

Check usage (experimental)

Contents

[edit] What can this extension do?

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

[edit] Usage

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>

[edit] Download instructions

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

[edit] Installation

  • 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

[edit] See also

Extension:SyntaxHighlight GeSHi

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox