Friday, 10 October 2008

Blog syntax highlighting: SyntaxHighlighter

I've been wanting a Javascript based purely client-side syntax highlighting solution for a while. In the past, I've used Python to HTML scripts and other similar things.

SyntaxHighlighter looks pretty good.


import stackless
import traceback

def f():
while 1:
pass

stackless.tasklet(f)()

while stackless.runcount > 1:
# If any tasklet runs for too long, kill it.
t = stackless.run(100000)
if t is not None:
traceback.print_stack(t.frame)
t.kill()