Custom style for Processing

33 views
Skip to first unread message

Peter Dickx

unread,
May 24, 2017, 11:46:53 PM5/24/17
to js-code-prettifier
I would like to create my own style for the Processing "language", so i can prettify this code by using <pre class="prettyprint processing">

This would be an "extenstion" to the java language style but with different colors.
Also i would like more keyword classes, now all keywords are the same color, but i would like to have something like a keyw1, keyw2, keyw3 class, where i can specify different groups of keywords to be different colors.

I do not want to replace the java style, this should work alongside java.

How can i make such an extension?

Amro

unread,
May 25, 2017, 8:53:44 AM5/25/17
to js-code-p...@googlegroups.com
Here's a minimal example: https://jsfiddle.net/amroamroamro/e5ho0c8p/1/

Notice the trick of defining custom classes as 'kwd1 kwd', that way if
use one of the builtin skins (prettify.css, etc.) that don't style
these custom classes 'kwd1', it will still work by falling back to the
regular 'kwd' class instead.

--Amro
Reply all
Reply to author
Forward
0 new messages