lib/github/markups.rb (view raw)
1markup(:markdown, /md|mkdn?|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
13command(:rest2html, /rest|rst/)
14
15command(:asciidoc2html, /asciidoc/)
16
17# pod2html is nice enough to generate a full-on HTML document for us,
18# so we return the favor by ripping out the good parts.
19#
20# Any block passed to `command` will be handed the command's STDOUT for
21# post processing.
22command("/usr/bin/env pod2html", /pod/) do |rendered|
23 if rendered =~ /<!-- INDEX BEGIN -->\s*(.+)\s*<!-- INDEX END -->/mi
24 `rm pod2htmd.tmp` if File.exists?('pod2htmd.tmp')
25 `rm pod2htmi.tmp` if File.exists?('pod2htmi.tmp')
26 $1
27 end
28end