lib/docify/markup.rb in docify-1.0.5 vs lib/docify/markup.rb in docify-1.0.6

- old
+ new

@@ -3,18 +3,10 @@ require 'rdiscount' module Docify module Markup extend self - - # Auto-detect format from filename and render content - def render(filename, content) - name = File.basename(filename.to_s.strip) - raise ArgumentError, 'Filename required!' if name.empty? - format = detect_format(name) - format == :text ? content : self.send(format, content) - end # Render content for RDoc def rdoc(content) markup = RDoc::Markup::ToHtml.new markup.convert(content) @@ -26,24 +18,8 @@ end # Render content for Textile def textile(content) RedCloth.new(content).to_html - end - - protected - - # Detect markup format from filename - def detect_format(filename) - case(filename) - when /\.rdoc/i - :rdoc - when /\.(md|mkdn?|mdown|markdown)/i - :markdown - when /\.textile/i - :textile - else - :text - end end end end \ No newline at end of file