Sha256: 1d7316e8a635a070edb902be708d4ad4bcf634993b15f146311d6309c908afb4
Contents?: true
Size: 740 Bytes
Versions: 3
Compression:
Stored size: 740 Bytes
Contents
require 'propaganda/renderer' require 'propaganda/formatter' module Propaganda def self.convert(input, output, title=nil, template=nil, engine=nil, verbose=false) title ||= File.basename(input, File.extname(input)) engine ||= detect(input) text = IO.read(input) formatter = Formatter.new text = formatter.format(text, title, engine) fop = Renderer.new(verbose) fop.render(text, output, template) end def self.detect(input) case File.extname(input) when '.textile' 'textile' when '.markdown', '.md' 'markdown' when '.html', '.xhtml' 'none' else raise "Unknown format for #{input}, use .html, .textile or .markdown extension" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
propaganda-0.4.0 | lib/propaganda.rb |
propaganda-0.3.0 | lib/propaganda.rb |
propaganda-0.2.0 | lib/propaganda.rb |