1,185 Views 3 Replies Last post: Feb 20, 2009 11:16 AM by nhamar RSS
Eugene Toporov Novice 39 posts since
Jul 14, 2008
Currently Being Moderated

Dec 5, 2008 2:35 AM

C# code syntax highlighting macro needed

We'd like to add C# to the list of languages for code syntax highlighting in Clearspace.

Is there an existing macro for this?

 

Any hints about its creation are appreciated. I only found this docon Building macros but don't want to re-invent the wheel.

 

Thanks,

-Eugene

Austen Rustrum Jive Employee 6,752 posts since
Feb 19, 2008
Currently Being Moderated
Dec 5, 2008 11:51 AM in response to: Eugene Toporov
Re: C# code syntax highlighting macro needed

Eugene,

 

I don't think that we presently have anything like this in our plugins community.  To implement the macro, I would recommend overriding the CodeMacro spring definition (in spring-renderContext.xml) to add in your own custom formatter:

 

    <bean id="codeMacro" class="com.jivesoftware.community.renderer.macro.CodeMacro" scope="prototype">
        <property name="enabled" value="true" />
        <property name="formatters">
            <list>
                <ref bean="plainCodeFormatter"/>
                <ref bean="javaCodeFormatter"/>
                <ref bean="xmlCodeFormatter"/>
                <ref bean="sqlCodeFormatter"/>
                <ref bean="htmlCodeFormatter"/>
            </list>
        </property>
        <property name="defaultFormatter" ref="plainCodeFormatter"/>
    </bean>

 

You'll need to create a new spring bean definition for your custom formatter and then add it to the list of formatters above.  Take a look at the javaCodeFormatter for an example formatter.

Austen Rustrum Jive Employee 6,752 posts since
Feb 19, 2008
Currently Being Moderated
Dec 9, 2008 6:55 AM in response to: Austen Rustrum
Re: C# code syntax highlighting macro needed

Eugene, was this helpful?  Did you have any additional questions?

nhamar Novice 244 posts since
Feb 3, 2009
Currently Being Moderated
Feb 20, 2009 11:16 AM in response to: Austen Rustrum
Re: C# code syntax highlighting macro needed

Hey Austen,

 

Is there a macro for C++ code highlighting? If not, is there a tutorial somewhere that will tell me how to create one?

 

Thanks,

Nathan

More Like This

  • Retrieving data ...

Bookmarked By (0)