WP-Markdown-Syntax-Sugar

WP Markdown Syntax Sugar is a simple plugin that works in conjunction with Markdown code blocks and highlight.js to
properly format code.

Author:Damien White (Visoft, Inc.) (profile at wordpress.org)
WordPress version required:3.1
WordPress version tested:3.5
Plugin version:0.1.1
Added to WordPress repository:13-08-2012
Last updated:03-01-2013
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:https://github.com/visoft/wp-markdown-syntax-...
Total downloads:1 525
Active installs:10+
plugin download
Click to start download

WP Markdown Syntax Sugar work in conjunction with plugins such as wp-markdown and wp-highlight.js. Markdown is fantastic markup for easily writing blogs, and highlight.js is an extremely easy way to highlight code examples. In most cases, highlight.js automatically detects the proper language for a block of code. In certain cases, primarily if your code example is short, highlight.js could improperly detect the language that you are using; that is where this plugin comes into play. By adding one line to your code blocks, you can explicitly set the language that you are using, allowing highlight.js to properly format your code.

The concept is inspired by the wp-markdown-syntax-highlight plugin.

The usage is extremely simple. Just add a shebang as the first line of your code example with the language you are using.

#!ruby
class Foo < Bar
  def hello
    puts "Hello World!"
  end
end

The shebang is removed, and the code is outputted as:

<pre><code class="language-ruby">class Foo < Bar
  def hello
    puts "Hello World!"
  end
end</code></pre>

Now the code block is properly formatted for highlight.js to do its magic, and the code snippet will be properly highlighted.


ChangeLog