CodeHighlight CSModule for CS v2007 RTM


Mon, Apr 16 2007

Downloads: 324
File size: 46.4kB
Views: 1,914
CodeHighlight CSModule for CS v2007 RTM
Filed under: ,

In order to install the CodeHilight CSModule under Community Server - this CSModule works only with CS v2007 RTM - in order to download a CS v2007 RC1 version of the component get "CodeHighlight CSModule for CS v2007 RC1":

Step 1:
In communityserver.config, replace the line


	<add name="ForumSourceCode" type="CommunityServer.Discussions.Components.SourceCodeModule, CommunityServer.Discussions" />

with the lines


  <add name="ForumSourceCode" type="CommunityServer.Discussions.Components.SourceCodeModule, CommunityServer.Discussions" enabled="false" />
  <add name="SourceCode" type="CommunityServer.CodeHighlight.CodeHighlighter, CommunityServer.CodeHighlight" />

Step 2:
Add in web.config, just under the <configuration> tag on the top of the file:


    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="CommunityServer.CodeHighlight.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <applicationSettings>
        <CommunityServer.CodeHighlight.Properties.Settings>
            <setting name="CodeWrapperHTML" serializeAs="String">
                <value>&lt;pre style="overflow: scroll; background-color: #f2f2f2;"&gt;{0}&lt;/pre&gt;</value>
            </setting>
            <setting name="UseLineNumbers" serializeAs="String">
                <value>False</value>
            </setting>
            <setting name="NumberWrapperHTML" serializeAs="String">
                <value>&lt;table border="0" cellpadding="0" cellspacing="0" style="background-color: #f2f2f2; border: solid 1px #e5e5e5; width: 100%;"&gt;
    &lt;tr style="vertical-align: top; line-height: normal;"&gt;
        &lt;td style="width: 40px; text-align: right;"&gt;
            &lt;pre style="font-family: courier new; font-size: 11px; color: gray; margin: 0px; padding: 2px; border-right: solid 1px #e7e7e7;"&gt;{0}&lt;/pre&gt;&lt;/td&gt;
        &lt;td&gt;
            &lt;pre style="overflow: scroll; margin:0px; padding: 2px; padding-left: 8px;"&gt;{1}&lt;/pre&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;</value>
            </setting>
        </CommunityServer.CodeHighlight.Properties.Settings>
    </applicationSettings>

Customize your installation:
The HTML code produced is surrounded with the HTML code in CodeWrapperHTML setting, and if the option to include line numbers is included - setting UseLineNumbers - then the HTML code in NumberWrapperHTML is used.

Use of [code][/code] tags:
In order to use the code highlighting in your posts use the tags [code language="C#"][/code] in a post's body. Languages supported: ASPX, C, C++, C#, COBOL, Eiffel, Fortan, Haskell, HTML, Java, Javascript, Mercury, MSIL, Pascal, Perl, PHP, Python, Ruby, SQL, Visual Basic, VBScript, VB.NET, XML. Make sure that the code pasted in your post, has no previous formating - copy the code to notepad first and then to the post's body in order to remove formating.

In order to make the HTML rendering, the CSModule uses the Highlight library of Thomas Johansen and Christian Nordbakk.

You are welcome to feedback,
George J.
george@capnias.org

Comments

game wrote re: CodeHighlight CSModule for CS v2007 RTM
on Wed, Aug 29 2007 6:33 AM
good .... thanks :)
mhmdkhamis wrote re: CodeHighlight CSModule for CS v2007 RTM
on Mon, Sep 17 2007 7:05 PM
thanks
mhmdkhamis wrote re: CodeHighlight CSModule for CS v2007 RTM
on Mon, Sep 17 2007 7:08 PM
good post
stianpr wrote re: CodeHighlight CSModule for CS v2007 RTM
on Tue, Oct 30 2007 5:50 AM
Did anyone actually got this to work?
العاب بنات wrote re: CodeHighlight CSModule for CS v2007 RTM
on Sat, Jun 14 2008 7:44 PM
thanks
堀北真希 画像 wrote re: CodeHighlight CSModule for CS v2007 RTM
on Thu, Jul 10 2008 10:46 PM
rent a car wrote re: CodeHighlight CSModule for CS v2007 RTM
on Mon, Jul 14 2008 7:36 AM
wow good Blogs Thanks Admin
wrote re: CodeHighlight CSModule for CS v2007 RTM
on Wed, Jul 23 2008 8:30 AM
wrote re: CodeHighlight CSModule for CS v2007 RTM
on Wed, Jul 23 2008 8:30 AM
wrote re: CodeHighlight CSModule for CS v2007 RTM
on Wed, Jul 23 2008 8:31 AM
wrote re: CodeHighlight CSModule for CS v2007 RTM
on Wed, Jul 23 2008 9:10 AM
wrote re: CodeHighlight CSModule for CS v2007 RTM
on Sat, Aug 9 2008 1:59 PM
great work
alhnuf wrote re: CodeHighlight CSModule for CS v2007 RTM
on Fri, Aug 15 2008 8:35 AM
alhnuf wrote re: CodeHighlight CSModule for CS v2007 RTM
on Fri, Aug 15 2008 8:36 AM
alhnuf wrote re: CodeHighlight CSModule for CS v2007 RTM
on Fri, Aug 15 2008 8:36 AM
الأزياء و حديقة حواء الأزياء و حديقة حواء   @   منزل و ديكور
alhnuf wrote re: CodeHighlight CSModule for CS v2007 RTM
on Fri, Aug 15 2008 8:37 AM
alhnuf wrote re: CodeHighlight CSModule for CS v2007 RTM
on Fri, Aug 15 2008 8:40 AM
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com