SyntaxHighlighter for Movable Type allows you to easily post syntax highlighted code all without loosing it’s formatting or making an manual changes on Movable Type 4 powered by SyntaxHighlighter 2.0.

Download

Functions and Limitations

This plugin has the following functions.

  • Added one tempalte tag and two text filters
  • Install SyntaxHighlighter 2.0 to mt-static
  • Use tempate tag instead of includeing css and javascript on html header
  • Write raw source code in entry by using text filter
  • Supported php dynamic publishing!

It also has the following problems oppositely.

  • The entry dosen’t other text filter (ex. rich text editor)
  • It is not supporeted the configuration of the SyntaxHighlighter
  • Required Movable Type 4 (I have tested with 4.2x, 4.3x and 5.0beta)

How to Use

1. Download this plugin and copy to your mt directory.

2. Add MTSyntaxHighlighterInclude tag to “HTML Header” tempates.

;

The MTSyntaxHighlighterInclude has brush and theme attributes. The brush attribute is required and the theme attribute is optional.

attribute SyntaxHighlighter 2.0
brush as3, csharp, cpp, css, delphi, diff, groovy, jscript, perl, java, php, plain, powershell , python, ruby, scala, sql, vb, xml(Use CSV)
theme default, django, emacs,fadetogrey,midnight, rdark

3. Create an Entry

Select SyntaxHighlighter or SyntaxHighlighter + Convert Line Breaks as Format

;

Write source code as following format:

[code:language]
source code
[/code]

language is supported in Brush aliases.

language Brush name File name
as3,actionscript3 ActionScript3 shBrushAS3.js
bash, shell Bash/shell shBrushBash.js
c-sharp, csharp C# shBrushCSharp.js
cpp, c C++ shBrushCpp.js
css CSS shBrushCss.js
delphi, pas, pascal Delphi shBrushDelphi.js
diff, patch Diff shBrushDiff.js
groovy Groovy shBrushGroovy.js
js, jscript, javascript JavaScript shBrushJScript.js
java Java shBrushJava.js
jfx, javafx JavaFX shBrushJava.js
perl, pl Perl shBrushPerl.js
php PHP shBrushPhp.js
plain, text Plain Text shBrushPlain.js
ps, powershell PowerShell shBrushPowerShell.js
py, python Python shBrushPython.js
rails, ror, ruby Ruby shBrushRuby.js
scala Scala shBrushScala.js
sql SQL shBrushSql.js
vb, vbnet Visual Basic shBrushVb.js
xml, xhtml, xslt, html, xhtml XML shBrushXml.js

After publishing, the entry is displayed.

;

(When theme attributes is emacs)

;

If you have already used the syntaxhighlighter 1.5

The syntaxhighlighter 2.0 changed the target html tag from version 1.5. You have to set “compatible with 1.5″ in settings.

See also: http://alexgorbatchev.com/wiki/SyntaxHighlighter:Upgrading

License

SyntaxHighlighter for Movable Type. Copyright (C) 2009 makoto_kw ( https://makotokw.com )

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

SyntaxHighlighter is licenced under LGPL 3. Copyright (C) 2004-2009 Alex Gorbatchev.

SyntaxHighlighter is donationware. If you are using SyntaxHighlighter 2.0 on your site or including it in your product, please donate.