Add literate Haskell renderer using literati
Jeremy McAnally jmcanally@github.com
Wed, 31 Oct 2012 16:50:45 -0400
4 files changed,
26 insertions(+),
0 deletions(-)
M
lib/github/markups.rb
→
lib/github/markups.rb
@@ -40,6 +40,10 @@ markup(:wikicloth, /mediawiki|wiki/) do |content|
WikiCloth::WikiCloth.new(:data => content).to_html(:noedit => true) end +markup(:literati, /lhs/) do |content| + Literati.render(content) +end + command(:rest2html, /re?st(\.txt)?/) command('asciidoc -s --backend=xhtml11 -o - -', /asciidoc/)
A
test/markups/README.lhs
@@ -0,0 +1,10 @@
+# Markdown + +Except with more magic added. + +> isPrefixOf :: (Eq a) => [a] -> [a] -> Bool +> isPrefixOf [] _ = True +> isPrefixOf _ [] = False +> isPrefixOf (x:xs) (y:ys)= x == y && isPrefixOf xs ys + +And Haskell. A lot of Haskell.
A
test/markups/README.lhs.html
@@ -0,0 +1,11 @@
+<h1>Markdown</h1> + +<p>Except with more magic added.</p> + +<pre lang="haskell"><code>isPrefixOf :: (Eq a) => [a] -> [a] -> Bool +isPrefixOf [] _ = True +isPrefixOf _ [] = False +isPrefixOf (x:xs) (y:ys)= x == y && isPrefixOf xs ys +</code></pre> + +<p>And Haskell. A lot of Haskell.</p>