SyntaxHighlighter 3.0.83

Fork Me On GitHub
whats new?
SyntaxHighlighter is an open source Java Script client side code syntax highlighter.
donate download installation autoloader configuration @syntaxhighlight

Groovy Example

      import groovy.swing.SwingBuilder
      import static java.awt.BorderLayout.*
      import java.awt.event.*
      
      //  set up variables
      count = 0
      def textlabel
      def text = "Actions: "
      def update = { c ->
          text += c
          textlabel.text = text
      }
      
      // create the listener
      def closureMap = [
          mousePressed:     { update 'M' },
          keyPressed:       { update 'K' },
          focusLost:        { update 'F' },
          windowIconified:  { update 'W' }
      ]
      def interfaces = [WindowListener, KeyListener, MouseListener, FocusListener]
      def listener = ProxyGenerator.instantiateAggregate(closureMap, interfaces)
      
      // now the GUI
      def swing = new SwingBuilder()
      def frame = swing.frame(title:'Frame') {
          borderLayout()
          textlabel = label(text:text, constraints: NORTH)
          button = button(text:'Click Me', constraints: SOUTH)
      }
      frame.addWindowListener listener
      ['Key', 'Mouse', 'Focus'].each {
          button."add${it}Listener" listener
          textlabel."add${it}Listener" listener
      }
      frame.pack()
      frame.show()
      
Brush nameBrush aliasesFile name
ActionScript3as3, actionscript3shBrushAS3.js
Bash/shellbash, shellshBrushBash.js
ColdFusioncf, coldfusionshBrushColdFusion.js
C#c-sharp, csharpshBrushCSharp.js
C++cpp, cshBrushCpp.js
CSScssshBrushCss.js
Delphidelphi, pas, pascalshBrushDelphi.js
Diffdiff, patchshBrushDiff.js
Erlangerl, erlangshBrushErlang.js
GroovygroovyshBrushGroovy.js
JavaScriptjs, jscript, javascriptshBrushJScript.js
JavajavashBrushJava.js
JavaFXjfx, javafxshBrushJavaFX.js
Perlperl, plshBrushPerl.js
PHPphpshBrushPhp.js
Plain Textplain, textshBrushPlain.js
PowerShellps, powershellshBrushPowerShell.js
Pythonpy, pythonshBrushPython.js
Rubyrails, ror, rubyshBrushRuby.js
ScalascalashBrushScala.js
SQLsqlshBrushSql.js
Visual Basicvb, vbnetshBrushVb.js
XMLxml, xhtml, xslt, html, xhtmlshBrushXml.js