all repos — markup @ b35ced8aebec9a030d9d9f936f9d804d49d9a869

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
17command(:rest2html, /re?st(\.txt)?/)
18
19command('asciidoc -s --backend=xhtml11 -o - -', /asciidoc/)
20
21# pod2html is nice enough to generate a full-on HTML document for us,
22# so we return the favor by ripping out the good parts.
23#
24# Any block passed to `command` will be handed the command's STDOUT for
25# post processing.
26command("/usr/bin/env perl -MPod::Simple::HTML -e Pod::Simple::HTML::go", /pod/) do |rendered|
27  if rendered =~ /<!-- start doc -->\s*(.+)\s*<!-- end doc -->/mi
28    $1
29  end
30end