all repos — markup @ 6690c6f1d27a65d931002f3728c00e81a02d9189

The code we use to render README.your_favorite_markup

Merge pull request #162 from jm/add_literate_haskell

Add literate Haskell renderer using literati
Ryan Tomayko rtomayko@gmail.com
Wed, 07 Nov 2012 20:55:42 -0800
commit

6690c6f1d27a65d931002f3728c00e81a02d9189

parent

05c637425b88f22ef564670404b8ce267a9a4f50

4 files changed, 26 insertions(+), 0 deletions(-)

jump to
M GemfileGemfile

@@ -5,4 +5,5 @@ gem "rdoc", "~>3.6"

gem "org-ruby", ">= 0.7.0" gem "creole", "~>0.3.6" gem "wikicloth", "=0.6.0" +gem "literati", "= 0.0.3" gem "rake"
M lib/github/markups.rblib/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 - -', /asc|adoc|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) =&gt; [a] -&gt; [a] -&gt; Bool +isPrefixOf [] _ = True +isPrefixOf _ [] = False +isPrefixOf (x:xs) (y:ys)= x == y &amp;&amp; isPrefixOf xs ys +</code></pre> + +<p>And Haskell. A lot of Haskell.</p>