code highlighting

For help on using the forums and feature requests for this site
benw

Re: code highlighting

Postby benw » Thu Sep 10, 2009 9:46 am

Apparently the "board attachment quota has been reached". Once this is fixed I'll upload the file, otherwise provide me with an email address and I'll email it instead.
Can you give it another try now? Its been increased.

Regards
Ben

allistar
Posts: 156
Joined: Fri Aug 14, 2009 11:02 am
Location: Mount Maunganui, Tauranga

Re: code highlighting

Postby allistar » Thu Sep 10, 2009 1:15 pm

Thanks. Here is the attachment.
Attachments
JHPExceptionDetail.cls.zip
Example Jade code that does syntax highlighting of Jade code.
(3.6 KiB) Downloaded 687 times

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: code highlighting

Postby ghosttie » Thu Feb 28, 2013 3:34 am

A Jade syntax highlighter function would need to be written in PHP and produce html output similar to http://php.net/manual/en/function.highlight-string.php, outputting only <span> and <br /> html tags in XHTML 1.0 Strict and use css classes for colorization.
It's been a long time (more than three years) since this topic was discussed - I kept putting it off because I was daunted by the prospect of writing a parser, especially since it feels like duplicating work other people have done.

I believe phpBB uses GeSHi for syntax highlighting - if this is the case then all we need to do to add a new language is to specify what the keywords, string delimiters, comment delimiters etc. are and GeSHi should take care of the rest.

If you can confirm that this board uses GeSHi then I (or anyone else) should be able to add JADE code highlighting very quickly. I already have a list of keywords etc. from when I created a JADE code highlighting syntax file for EditPlus.
I have a catapult. Give me all the money or I will fling an enormous rock at your head.


Return to “Forum Feedback and Help”

Who is online

Users browsing this forum: No registered users and 7 guests

cron