Can anyone recommend a good way to get Haskell syntax highlighting for blog posts? I've been using Gist, which works very well, except that Gists don't show up in RSS feeds.
Followup: Actually, these instructions for getting Blogger to use Google's code prettify work on my blog: http://lukabloga.blogspot.com/2008/10/to-test-new-highlighting.html
Sigh... Sorry for triple posting, but I don't see an edit button: You'll need to add one more script include to this file: http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-hs.js
and also follow the instructions there for posting.
I write my blog posts (http://randomagent.wordpress.com) in emacs with org-mode. When editing code, org-mode gives control to the major mode associated with that language.
Then, when you export your text to html to past on your favourite blog manager, org-mode uses the adequate major mode to highlight your code and export the right html code for the colors.
See this [1] or this [2]
ReplyDelete[1]: http://greayer.wordpress.com/2009/10/26/blogging-literately-in-haskell/
[2]: http://pgraycode.wordpress.com/2010/07/28/enter-hacoteb/
Use pandoc and make sure to "cabal install" it with the "-f highlighting" option -- you can then highlight code using the syntax:
ReplyDelete~~~~~~~~~~ {.haskell}
foo :: Int -> Int
foo = (+2)
~~~~~~~~~~
This is the most convenient way I've found.
We [1] use code colorer [2], a WordPress plugin apparently based on GeSHi [3]. It's basic, but works well and supports other languages as well.
ReplyDelete[1] https://blog.typlab.com/
[2] http://wordpress.org/extend/plugins/codecolorer/
[3] http://qbnz.com/highlighter/
For my blog, I ran the code through hscolour and generate html output and then I added the CSS classes to my blog template.
ReplyDeleteYou can also use "Highlight" executable that is optional with highlighting-kate:
ReplyDeletecabal install highlighting-kate -fexecutable
Google's code-prettify looks to support Haskell but I haven't used it myself (yet): http://code.google.com/p/google-code-prettify/
ReplyDeleteFollowup: Actually, these instructions for getting Blogger to use Google's code prettify work on my blog: http://lukabloga.blogspot.com/2008/10/to-test-new-highlighting.html
ReplyDeleteBest of luck!
Sigh... Sorry for triple posting, but I don't see an edit button: You'll need to add one more script include to this file: http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-hs.js
ReplyDeleteand also follow the instructions there for posting.
I write my blog posts (http://randomagent.wordpress.com) in emacs with org-mode. When editing code, org-mode gives control to the major mode associated with that language.
ReplyDeleteThen, when you export your text to html to past on your favourite blog manager, org-mode uses the adequate major mode to highlight your code and export the right html code for the colors.
I use SHJS to highlight Haskell syntax with JavaScript. It highlights more correctly than google-code-prettify.
ReplyDeletehttp://nix-tips.blogspot.com/2010/09/javascript-highlighter-for-haskell-code.html
Following Eric@Typlab's suggestion (thanks!), I'm using CodeColorer with Wordpress 3.3 and it works beautifully.
ReplyDelete-- Ivan @ Keera Studios
PS. I know that this is an old thread, but it's still the first result when you google "haskell wordpress code highlighting".