5 Replies Latest reply on Mar 24, 2009 11:29 AM by cromero

    {code:java}

      I created a new document (Clearspace 1.0.3 & Firefox 2.0.0.2) and pasted a bash script into it between

       tags. These tags were converted into 

      resulting in syntax coloring of anything that looked like a java keyword in the shell script.

       

      I like the idea of syntax coloring. Is there a template for shell script syntax too, something like

       or 

      ? And can I turn off syntax coloring when I don't want it?

       

      Thanks,

      niranjan

        • Re: {code:java}

          hi niranjanv,

           

          The code macro currently only supports Java, XML and SQL, but has hooks for you to starting writing a bash or shellscript formatter.  I'm assuming you've got a source build, check out the following classes:

           

          src/java/com/jivesoftware/community/renderer/macro/CodeMacro.java

          src/java/com/jivesoftware/community/renderer/macro/code/JavaCodeFormatter.java

           

          Cheers,

           

          AJ

            • Re: {code:java}

              The code macro currently only supports Java, XML and

              SQL, but has hooks for you to starting writing a

               

              I tried

              , doesn't do anything different than plain 

              ;  and  breaks the code tag (appears as normal text). Am I doing something wrong?

               

              Would make much use of both C/C++, bash and PHP code formatting as well.

                • Re: {code:java}

                  In looking at the CodeMacro class it looks like if you are using the WYSIWG editor the renderer does not fire:

                   

                   

                  //        else if (renderTarget == RenderTarget.TARGET_WYSIWYG_EDITOR) {

                   

                  <snipped>

                   

                  //            body = "<pre class=\"jive-pre\"><code class=\"jive-code\">" +

                  //                    renderContext.getRenderedTextStore().addText(body) + "</code></pre>";

                  //            return body;

                  //        }

                   

                  This could be the problem around the code editor not displaying correctly, since I am currently unable to get the code formatting in CS 1.1.1.

                   

                  Cheers,

                   

                  Anthony