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
21markup(:wikicloth, /mediawiki|wiki/) do |content|
22 WikiCloth::WikiCloth.new(:data => content).to_html(:noedit => true)
23end
24
25command(:rest2html, /re?st(\.txt)?/)
26
27command('asciidoc -s --backend=xhtml11 -o - -', /asc|adoc|asciidoc/)
28
29# pod2html is nice enough to generate a full-on HTML document for us,
30# so we return the favor by ripping out the good parts.
31#
32# Any block passed to `command` will be handed the command's STDOUT for
33# post processing.
34command("/usr/bin/env perl -MPod::Simple::HTML -e Pod::Simple::HTML::go", /pod/) do |rendered|
35 if rendered =~ /<!-- start doc -->\s*(.+)\s*<!-- end doc -->/mi
36 $1
37 end
38end