all repos — markup @ f09cb9eb522c1df0f5875e05522e56edd0ac58ef

The code we use to render README.your_favorite_markup

lib/github/markups.rb (view raw)

 1markup(:markdown, /md|mkdn?|mdown|markdown/) do |content|
 2  Markdown.new(content).to_html
 3end
 4
 5markup(:redcloth, /textile/) do |content|
 6  RedCloth.new(content).to_html
 7end
 8
 9markup('github/markup/rdoc', /rdoc/) do |content|
10  GitHub::Markup::RDoc.new(content).to_html
11end
12
13markup('org-ruby', /org/) do |content|
14  Orgmode::Parser.new(content).to_html
15end
16
17markup(:creole, /creole/) do |content|
18  Creole.creolize(content)
19end
20
21command(:rest2html, /re?st(\.txt)?/)
22
23command('asciidoc -s --backend=xhtml11 -o - -', /asciidoc/)
24
25# pod2html is nice enough to generate a full-on HTML document for us,
26# so we return the favor by ripping out the good parts.
27#
28# Any block passed to `command` will be handed the command's STDOUT for
29# post processing.
30command("/usr/bin/env perl -MPod::Simple::HTML -e Pod::Simple::HTML::go", /pod/) do |rendered|
31  if rendered =~ /<!-- start doc -->\s*(.+)\s*<!-- end doc -->/mi
32    $1
33  end
34end