lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> It would be cool if the code was syntax-colorized. Any suggestions?

The easiest way to do this is using a Java Script library, letting the
syntax highlighting happen on the client side. There are many
different ones available. Not all support Lua, but some do. Sérgio
Medeiros and I recently wrote a Lua plugin for Alex Gorbatchev's
SyntaxHighlighter (http://alexgorbatchev.com/wiki/). Here is a quick
demo:

http://spu.tnik.org/en/Syntax_Highlighting

The code is at:

http://gitorious.org/sputnik/mainline/blobs/master/syntaxhighlighter/original/scripts/shBrushLua.js

There is also a Lua module that encapsulates SyntaxHighlighter for
anyone is interested in integrating it into a Lua web application.
(The Lua module basically gives you a function for generating
customized JavaScript that you can then serve to the client - handy if
you want _all_ of your requests to be answers by Lua.) We can release
it as a rock if there is interest.

- yuri