Class: IPT::README::MarkdownFormatter

Inherits:
AbstractFormatter show all
Defined in:
lib/ipt/readme.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractFormatter

supports

Constructor Details

#initializeMarkdownFormatter

Returns a new instance of MarkdownFormatter.



27
28
29
30
31
32
33
34
# File 'lib/ipt/readme.rb', line 27

def initialize
  begin
    require 'bluecloth'
  rescue LoadError => e
    puts "The bluecloth gem is required if you want to create HTML Readme files."
    puts "Install using: sudo gem install BlueCloth"
  end      
end

Class Method Details

.supported_formatsObject



23
24
25
# File 'lib/ipt/readme.rb', line 23

def self.supported_formats
  %w(md markdown)
end

Instance Method Details

#to_html(input) ⇒ Object



36
37
38
# File 'lib/ipt/readme.rb', line 36

def to_html(input)
  BlueCloth.new(input).to_html
end