Created
June 14, 2013 05:25
-
-
Save wzpan/5779645 to your computer and use it in GitHub Desktop.
Using Pandoc instead of RedCarpet to render the page in Ruhoh. Supports markdown, rst and textile.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "pandoc-ruby" | |
class Ruhoh | |
module Converter | |
module Markdown | |
def self.extensions | |
['.md', '.markdown'] | |
end #self.extensions | |
def self.convert(content) | |
converter = PandocRuby.new(content).to_html(:smart,:mathjax,:email_obfuscation => :javascript) | |
converter | |
end #self.convert | |
end # Markdown | |
module Textile | |
def self.extensions | |
['.textile'] | |
end #self.extensions | |
def self.convert(content) | |
converter = PandocRuby.new(content).to_html(:smart,:mathjax,:'email-obfuscation' => :javascript) | |
converter | |
end #self.convert | |
end # Textile | |
module RST | |
def self.extensions | |
['.rst'] | |
end #self.extensions | |
def self.convert(content) | |
converter = PandocRuby.new(content).to_html(:smart,:mathjax,:'email-obfuscation' => :javascript) | |
converter | |
end #self.convert | |
end # RST | |
module Html | |
def self.extensions | |
['.htm', '.html'] | |
end | |
def self.convert(content) | |
content | |
end | |
end # Html | |
end # Converter | |
end # Ruhoh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment