Friday, September 25, 2009

Format code in Windows Live Writer

I never got the Code Snippet plugin for Windows Live Writer to work. Below is the error on my system:-

image

Rather the Source Code plugin works like a charm:-

Formats following languages (Wilco Bauwers Syntax Highlighting):
ASPX, C, C#, C++, COBOL, Cold Fusion, CSS, Eiffel, Fortran, Haskell, Java, JavaScript, JScript, Mercury, MSIL, Pascal, Perl, PHP, Python, Ruby, SQL, Visual Basic, Visual Basic Script, XML.
In addition it provides live preview and options to adjust background color, border color, font size, and box width.
UPDATED: Line Numbering, Alternating Line Style, tab replacement, selection ...
Source code can be found at http://www.amergerzic.com/post/WLWSourceCodePlugin.aspx.

image

Simple format of Java code

public class SourceCodeFormatter
{
    /* Member 1 */
    public static string member1;
    /* Member 2 */
    private int member2;
    // Constructor
    public SourceCodeFormatter()
    {
    }
}

 


Insert box around code and line numbers

  1: public class SourceCodeFormatter
  2: 
  3: {
  4: 
  5:     /* Member 1 */
  6: 
  7:     public static string member1;
  8: 
  9:     /* Member 2 */
 10: 
 11:     private int member2;
 12: 
 13:     // Constructor
 14: 
 15:     public SourceCodeFormatter()
 16: 
 17:     {
 18: 
 19:     }
 20: 
 21: }
  

Alternating colors + selection:-

public class SourceCodeFormatter
{
    /* Member 1 */
    public static string member1;
    /* Member 2 */
    private int member2;
    // Constructor
    public SourceCodeFormatter()
    {
    }
}

 


No more escaping and formatting code!!

No comments:

Post a Comment

Thank you for your feedback