Syntax Highlighting User Script

Started by drizz, April 07, 2011, 01:34:09 PM

Previous topic - Next topic

drizz

This is client side syntax highlighting user script using google code prettify. (http://code.google.com/p/google-code-prettify/)
It only modifies html on your side so you can enjoy colors of your liking instead of "black on silver" text.

For now it is only working with Opera, but can be modified to work with Firefox or other browsers.

Of course there is no ASM definition so i had to create one myself (Modified from lang-lisp.js, still WiP).
To see the definition (it's that base64 string) fire up Opera Dragonfly and look for the last script in <head> (or use online decoder)
The reason for base64 is I didn't feel like escaping all those characters to make it text and I couldn't make it work with "file://localhost/" path.

All colors are default, to change them see comment block below "head.appendChild(estyle);" line and apply it to createTextNode.

QuoteSave this as "whatever.js" in you user javascript folder (create one and set it in "Settings > Preferences > Advanced > Content > JavaScript"  if it doesn't exist)

Screenshot:

Screenshot is from http://www.masm32.com/board/index.php?topic=16357.msg135462#msg135462


EDIT added greasemonkey script for firefox (also opera compatible)
-- partially working under FF4
The truth cannot be learned ... it can only be recognized.