Sha256: 17afcd82002b0747413e063f8ffeb8439df1d6d26fb19616e9272d6e100ddfec

Contents?: true

Size: 1.7 KB

Versions: 1

Compression:

Stored size: 1.7 KB

Contents

module MarkdownSelect
  module Engine
   
    def pandoc_ruby_to_html( content )
      content = PandocRuby.new( content, :from => :markdown, :to => :html ).convert
    end
  
    def pandoc_ruby_to_html_incremental( content )
      content = PandocRuby.new( content, :from => :markdown, :to => :html ).convert
      content = content.gsub(/<(ul|ol)/) do |match|
        "#{Regexp.last_match(0)} class='step'"
      end
      content
    end
  
    # sample how to use your own converter
    # configure in markdown.yml
    # pandoc-ruby:
    #  converter: pandoc-ruby-to-s5
  
    def pandoc_ruby_to_s5( content )
      content = PandocRuby.new( content, {:from => :markdown, :to => :s5}, :smart ).convert
      content = content.gsub(/class="incremental"/,'class="step"')
      content = content.to_a[13..-1].join # remove the layout div
    end

    def pandoc_ruby_to_s5_incremental( content )
      content = PandocRuby.new( content, {:from => :markdown, :to => :s5 }, :incremental, :smart ).convert
      content = content.gsub(/class="incremental"/,'class="step"')
      content = content.to_a[13..-1].join # remove the layout div
    end
    

    def rdiscount_to_html( content )
      RDiscount.new( content ).to_html
    end
  

    def rpeg_markdown_to_html( content )
      PEGMarkdown.new( content ).to_html
    end
  

    def maruku_to_html( content )
      Maruku.new( content, {:on_error => :raise} ).to_html
    end
  

    def bluecloth_to_html( content )
      BlueCloth.new( content ).to_html
    end
  

    def kramdown_to_html( content )
      Kramdown::Document.new( content ).to_html
    end      
  
  end # module Engine
end # module MarkdownSelect  

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
markdown-0.0.1 lib/markdown_select/engine.rb