all repos — markup @ 8444bdc5b26f29ee62c1c100cc377534d23bb6a9

The code we use to render README.your_favorite_markup

Add literate Haskell renderer using literati
Jeremy McAnally jmcanally@github.com
Wed, 31 Oct 2012 16:50:45 -0400
commit

8444bdc5b26f29ee62c1c100cc377534d23bb6a9

parent

c16ac47743d51f3a51d7db4771d852817a703b18

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.2" 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 - -', /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>