Reputation:
I'm making a blog in PHP and I'd really like to have syntax highlighting on Haskell code.
Are there any tools for that out there?
I've found hscolour but I don't know if it's possible to integrate it in PHP.
I'm using CakePHP if that makes a difference.
Thanks.
Upvotes: 1
Views: 769
Reputation: 41481
I use SHJS JavaScript syntax highlighter. It is based on on GNU Source-highlight, and highlights more correctly than google-code-prettify and GeSHi.
See also: How to setup SHJS for Haskell.
Comparison, the last time I checked:
-->
operator from the comments-->
operator from the comments--|
operator from the commentsUpvotes: 3
Reputation: 2134
You could use the Alex Gorbatchev's SyntaxHighlighter. Its javascript and really simple and well supported, easy to install and modify. Here are some instructions for blogger... but all you have to do you to do is remove the blogger=true line for a php CakeApp.
http://code-slim-jim.blogspot.com/2010/11/adding-syntax-higher-to-your-blog.html
And here is the Haskel brush for it:
https://github.com/mrueegg/haskell_syntax_highlighter
Upvotes: 0
Reputation: 4814
I really like how GitHub highlights Haskell code, so I hacked at GeSHi's Haskell syntax file for a while until it worked in a similar fashion. It hasn't been heavily tested, but someone might find it useful.
You can download it from my blog entry, GitHub Haskell colours for GeSHi.
Upvotes: 0
Reputation: 29965
Here is a Geshi helper for CakePHP: http://www.mech7.net/articles/view/7/cakephp-geshi-helper
Upvotes: 0
Reputation: 137947
Many tools support Haskell syntax highlighting: kate, GeSHI, pygments. Calling into haskell-color or hscolour. Pick whichever is easiest for you to interface with.
Upvotes: 0
Reputation: 67232
The web site is down at the moment, so I can't confirm, but I am most positive GeSHi has support.
Upvotes: 1
Reputation: 400932
GeSHi is a PHP library that's quite often used for code-highlighting.
Judging from the list of supported languages, it seems it supports Haskell -- and there's a demo page if you want to try first.
(Right now, the website seems not to be responding :-( Still, it's available from Google search's cache)
Upvotes: 3