WP-Syntax free WordPress plugin
Description
WP-Syntax free WordPress plugin
WP-Syntax provides clean syntax highlighting using
GeSHi — supporting a wide range of popular
languages. It supports highlighting with or without line numbers and maintains formatting while copying snippets of code
from the browser.
It avoids conflicts with other 3rd party plugins by running an early
pre-filter and a late post-filter that substitutes and pulls the code snippets
out first and then pushes them back in with highlighting at the end. The
result is source code formatted and highlighted the way you intended.
Usage, Supported Languages, Styling Guidelines, and Release Notes are availabe
in the Other Notes section.
Want to contribute? WP-Sytax can be found on Github. Fork and submit your pull requests today!
Basic Usage
Wrap code blocks with
and
where “LANGUAGE”
is a GeSHi supported language syntax.
The line attribute is optional. More usage examples
Usage
Wrap code blocks with and
where “LANGUAGE” is a GeSHi supported
language syntax. See below for a full list of supported languages.
The line attribute is optional.
Example 1: PHP, no line numbers
Example 2: Java, with line numbers
public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } }
Example 3: Ruby, with line numbers starting at 18
class Example def example(arg1) return "Hello: " + arg1.to_s end end
Example 4: If your code already has html entities escaped, use escaped=”true” as an option
Hello
Example 5: PHP, with line numbers and highlighting a specific line
Example 6: PHP, with a caption (file and/or file path of the source file)