public
Description: A Mephisto port of Tom Moertel's typo:haskell plugin
Homepage:
Clone URL: git://github.com/emk/filtered_column_haskell_macro.git
README.rdoc

FilteredColumnHaskellMacro

This Mephisto plugin is based on a Typo plugin by Tom Moertel.

To use it, you need to have HsColour in your path. You can install it using:

  sudo cabal install --global HsColour

Of course, this assumes that you already have GHC and Cabal installed on your system. This can frankly be a bit tricky on shared web servers.

Installation

From inside your copy of Mephisto, run:

  script/plugin install git://github.com/emk/filtered_column_haskell_macro.git

Example

Use <macro:haskell> to wrap your code.

  <macro:haskell>
  addTwo :: Num a => a -> a -> a
  addTwo x y = x + y
  </macro:haskell>

Updating Your Theme

You will need to add some syntax-coloring rules to main.css. Here’s a minimal set of rules adapted from Tom Moertel’s original blog post.

  .haskell_code .keyglyph {color: #b8860b;}
  .haskell_code .keyword {color: #a020f0;}
  .haskell_code .comment,
  .haskell_code .comment a {color: #b22222;}
  .haskell_code .str,
  .haskell_code .chr {color: #bc8f8f;}
  .haskell_code .conid {color: #228b22;}

License

Copyright:2006 Tom Moertel, released under the GPL version 3.
Copyright:2008 Eric Kidd, released under the GPL version 3.

Note that if you exclude Tom Moertel’s code in lib/haskell_macro.rb, the rest of the code in this plugin is also available under the MIT license.