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.
From inside your copy of Mephisto, run:
script/plugin install git://github.com/emk/filtered_column_haskell_macro.git
Use <macro:haskell>
to wrap your code.
<macro:haskell> addTwo :: Num a => a -> a -> a addTwo x y = x + y </macro:haskell>
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;}
- 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.