all repos — markup @ asciidoc-fix

The code we use to render README.your_favorite_markup

lib/github/markups.rb (view raw)

 1# asciidoc
 2command('asciidoc --safe --backend=xhtml11 -o - -', /asciidoc/) do |rendered|
 3  if rendered =~ /<body>\n(.*)<div id="footnotes">/m
 4    $1
 5  end
 6end
 7
 8# creole
 9markup(:creole, /creole/) do |content|
10  Creole.creolize(content)
11end
12
13# markdown
14markup(:markdown, /md|mkdn?|mdown|markdown/) do |content|
15  Markdown.new(content).to_html
16end
17
18# org
19markup('org-ruby', /org/) do |content|
20  Orgmode::Parser.new(content).to_html
21end
22
23# pod
24command("/usr/bin/env perl -MPod::Simple::HTML -e Pod::Simple::HTML::go", /pod/) do |rendered|
25  if rendered =~ /<!-- start doc -->\s*(.+)\s*<!-- end doc -->/mi
26    $1
27  end
28end
29
30# rdoc
31markup('github/markup/rdoc', /rdoc/) do |content|
32  GitHub::Markup::RDoc.new(content).to_html
33end
34
35# rest
36command(:rest2html, /re?st(\.txt)?/)
37
38# textile
39markup(:redcloth, /textile/) do |content|
40  RedCloth.new(content).to_html
41end