Download CodeHighlight for BlogEngine.NET : CodeHighlight_10.zip

Install CodeHighlight in BlogEngine.NET:

1. Decompress ths ZIP file.
2. Copy CodeHighlightingExtension.cs file to \App_Code\Extensions folder
3. Copy Definitions.xml , Lonwas.Highlight.dll files to \bin folder
4. (optional) If you want change default formatted style , Using notepad open Web.Config Add blow lines in <appSettings> tag of the file.
1
2
3
4
5
6
7
8
9
10
11
12
        <add key="CodeWrapperHTML" value="&lt;/p&gt;&lt;table border=&quot;0&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #f2f2f2; border: solid 1px #e5e5e5; width: 100%;&quot;&gt;
&lt;tr style=&quot;vertical-align: top; line-height: normal;&quot;&gt;&lt;td&gt;&lt;pre style=&quot;overflow: scroll; margin:0px; padding: 2px; padding-left: 8px;&quot;&gt;{0}
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;" />
        <add key="UseLineNumbers" value="true" />
        <add key="NumberWrapperHTML" value="&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #f2f2f2; border: solid 1px #e5e5e5; width: 100%;&quot;&gt;
    &lt;tr style=&quot;vertical-align: top; line-height: normal;&quot;&gt;
        &lt;td style=&quot;width: 40px; text-align: right;&quot;&gt;
            &lt;pre style=&quot;font-family: courier new; font-size: 11px; color: gray; margin: 0px; padding: 2px; border-right: solid 1px #e7e7e7;&quot;&gt;{0}&lt;/pre&gt;&lt;/td&gt;
        &lt;td&gt;
            &lt;pre style=&quot;overflow: scroll; margin:0px; padding: 2px; padding-left: 8px;&quot;&gt;{1}&lt;/pre&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;" />

    Example :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
    <appSettings>
        ...
      
        <add key="CodeWrapperHTML" value="&lt;/p&gt;&lt;table border=&quot;0&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #f2f2f2; border: solid 1px #e5e5e5; width: 100%;&quot;&gt;
&lt;tr style=&quot;vertical-align: top; line-height: normal;&quot;&gt;&lt;td&gt;&lt;pre style=&quot;overflow: scroll; margin:0px; padding: 2px; padding-left: 8px;&quot;&gt;{0}
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;" />
        <add key="UseLineNumbers" value="true" />
        <add key="NumberWrapperHTML" value="&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #f2f2f2; border: solid 1px #e5e5e5; width: 100%;&quot;&gt;
    &lt;tr style=&quot;vertical-align: top; line-height: normal;&quot;&gt;
        &lt;td style=&quot;width: 40px; text-align: right;&quot;&gt;
            &lt;pre style=&quot;font-family: courier new; font-size: 11px; color: gray; margin: 0px; padding: 2px; border-right: solid 1px #e7e7e7;&quot;&gt;{0}&lt;/pre&gt;&lt;/td&gt;
        &lt;td&gt;
            &lt;pre style=&quot;overflow: scroll; margin:0px; padding: 2px; padding-left: 8px;&quot;&gt;{1}&lt;/pre&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;" />
    </appSettings>


How to use :
In order to use the code highlighting in your posts use the tags [code language="C#"][/code] in a post's body. Languages supported: SPX, C, C++, C#, COBOL, Eiffel, Fortan, Haskell, HTML, Java, Javascript, Mercury, MSIL, Pascal, Perl, PHP, Python, Ruby, SQL, Visual Basic, VBScript, VB.NET, XML.

Code Highlight Library :
Lonwas Highlight
http://www.projectdistributor.net/Projects/Project.aspx?projectId=11

Release note :
2008/09/13
1.0.0 First release version for BlogEngine.net 1.4.5


License :
Free , Welcome to feedback

by dmwc
Email: dmwc@ruri.com.tw
Project page : http://update.to/be/codehighlight/
Homepage :http://update.to/