Windows Live Writer - Syntax Highlighter Plugin

My second Windows Live Writer Plugin is another one which works with a pre-installed blog Plugin.

SyntaxHighlighter is a set of JavaScript libraries that works on client to format source code for display source code on a page.

In order to use the Plugin, just select the syntax language from the drop down list, then write or paste in your code, as it appears in your IDE. Next select from the advanced options if required and hit insert.

The Plugin will insert a <PRE> block, and when published to your site, will be formatted correctly.

You should read the usage instructions for the SyntaxHighlighter here for full details.

If you have any comments, feedback or suggestions on this Plugin, use the contact page.

 

You can download the file here: Download

Instructions For Use

  1. To use the Plugin, run the MSI file and install as usual.
  2. Open WLW. You should see the Plugin in your Insert list ‘Insert Syntax Highlighter Block’
  3. To Insert some code position the cursor at the point in your entry where you want the code to appear, and click the Insert Syntax Plugin.
  4. You will be presented with the Plugin screen:
    image
  5. At This point you should select the language from the drop down list.
  6. Next either type or paste the code you need into the the large text box. The code should appear exactly as you want it to on your entry:
    image
  7. Next select the options that you want.
    1. Hide Gutter - This will hide the gutter on the left hand side showing the line numbers
    2. Hide Controls - This will hide the controls at the top of the code block for copy, print, etc
    3. Collapse Block - This will show the code collapsed by default, requiring the reader to manually expand the block. Handy when space is a problem
    4. Show Row Columns - This will show row columns in the first line
    5. Line Count Start - When displaying the row numbers it will default to starting on line 1. This can be changed if, for example, you have split your code up and wish to use a continuation in a different block.
  8. Once you have selected your options, hit the Insert button. This will put your code into your entry. At this point it will look like unformatted text. This is because the actual formatting is done by the JavaScript on your blog page.
    image
    Public Function Foo() As String
    	Return "Bar"
    End Function