[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Some minor FAQ tweaks (a bit delayed).
- From: Yuri Takhteyev <yuri@...>
- Date: Fri, 14 Aug 2009 10:30:27 -0400
> 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