Class: IPT::README::MarkdownFormatter
- Inherits:
-
AbstractFormatter
- Object
- AbstractFormatter
- IPT::README::MarkdownFormatter
- Defined in:
- lib/ipt/readme.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ MarkdownFormatter
constructor
A new instance of MarkdownFormatter.
- #to_html(input) ⇒ Object
Methods inherited from AbstractFormatter
Constructor Details
#initialize ⇒ MarkdownFormatter
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_formats ⇒ Object
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 |