thumb An easy to use WordPress plugin that provides a simple way for embedding syntax-highlighted source code within pages or posts on your website, without losing it’s formatting or making any manual changes. Supporting 14 languages, 16 shortcodes and 36 themes. The syntax highlighting feature implemented via a CodeMirror library. If you want more options then tell me and I will be happy to add it.



Description

WP Plugin "My Syntax Highlighter"

Syntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. Syntax highlighting is one strategy to improve the readability and context of the text; especially for code that spans several pages. The reader can easily ignore large sections of comments or code, depending on what they are looking for.

This plugin also uses standalone Shortcode-Processor to prevent WordPress from converting newlines to HTML paragraphs, replacing apostrophes with typographic quotes and so on.

This plugin is just plug and play, no tedious configurations or hacks, just install, enable and start using your new shortcodes.

Features

  • Easy to use Settings Page
  • Live preview on Settings Page
  • Standalone Shortcode-Processor
  • Syntax highlighting (by CodeMirror)
  • Line numbering
  • 36 Themes
  • 14 Languages
  • 16 Shortcodes
  • Allow shortcodes in the text widget
  • Ready for translation (POT file included)
  • Published on WordPress.org

A list of supported languages:

Click to view language examples. Highlighted with Default theme.

A list of supported shortcodes:

  • [code][/code]
  • [php][/php]
  • [javascript][/javascript]
  • [js][/js]
  • [xml][/xml]
  • [html][/html]
  • [css][/css]
  • [scss][/scss]
  • [less][/less]
  • [sass][/sass]
  • [markdown][/markdown]
  • [perl][/perl]
  • [sql][/sql]
  • [mysql][/mysql]
  • [shell][/shell]
  • [bash][/bash]

A list of supported themes:

  • 3024-day
  • 3024-night
  • ambiance-mobile
  • ambiance
  • base16-dark
  • base16-light
  • blackboard
  • cobalt
  • colorforth
  • eclipse
  • elegant
  • erlang-dark
  • lesser-dark
  • liquibyte
  • mbo
  • mdn-like
  • midnight
  • monokai
  • neat
  • neo
  • night
  • paraiso-dark
  • paraiso-light
  • pastel-on-dark
  • rubyblue
  • solarized
  • the-matrix
  • tomorrow-night-bright
  • tomorrow-night-eighties
  • ttcn
  • twilight
  • vibrant-ink
  • xq-dark
  • xq-light
  • zenburn

Screenshots

  1. Plugin settings page. WP plugin "My Syntax Highlighter" by Arthur Gareginyan
  2. Example of post with added source code and wrapped it in shortcode provided by this plugin. Default theme of highlighter. WP plugin "My Syntax Highlighter" by Arthur Gareginyan
  3. Example of post with added source code and wrapped it in shortcode provided by this plugin. The “The Matrix” theme of highlighter. WP plugin "My Syntax Highlighter" by Arthur Gareginyan
  4. Example of post with added source codes on multiple language and wrapped it in shortcode provided by this plugin. Default theme of highlighter. WP plugin "My Syntax Highlighter" by Arthur Gareginyan

Quick-Start Guide

  1. Upload “My Syntax Highlighter” to the /wp-content/plugins/ directory.
  2. Activate the plugin through the “Plugins” menu in WordPress.
  3. Go to “Settings” → “My Syntax Highlighter”.

Usage

Just switch to the Text/HTML editor and wrap your source code in one of the supported shortcodes (like [code]...[/code] that is universal shortcode) and this plugin takes care of the rest. Example:

[code]
This 

is 

an "example"!
[/code]

In this case, the shortcode will prevent WordPress from inserting paragraph breaks between This, is and an "example", as well as ensure that the double quotes around example are not converted to typographic (curly) quotes.

To avoid problems, only edit posts that contain your source code in Text/HTML mode.

Translation

This plugin is translate ready. But If your language is not available you can make one. The .pot file is included and placed in “languages” folder. Many of plugin users would be delighted if you shared your translation with the community. Just send the translation files (*.po, *.mo) to me at the arthurgareginyan@gmail.com and I will include the translation within the next plugin update.

License

gplv3This plugin is open-sourced software licensed under the GNU General Public License, version 3 (GPLv3) and is distributed free of charge.

Commercial licensing (e.g. for projects that can’t use an open-source license) is available upon request.

Download

.ORGDownload from

Fork on Github


Contribution

Developing plugins is long and tedious work. If you benefit or enjoy this plugin please take the time to:


Arthur Gareginyan

Arthur Gareginyan

Arthur is a designer and full stack software engineer. He is the founder of MyCyberUniverse.com. His personal website can be found at arthurgareginyan.com. Check out his free WordPress plugins at wordpress.org.

Follow Arthur: