Class: Blogdoor::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/blogdoor/converter.rb

Defined Under Namespace

Classes: BlockCodeWithFilename

Instance Method Summary collapse

Constructor Details

#initializeConverter

Returns a new instance of Converter.



6
7
8
9
# File 'lib/blogdoor/converter.rb', line 6

def initialize
  renderer = BlockCodeWithFilename.new
  @markdown = Redcarpet::Markdown.new(renderer, fenced_code_blocks: true)
end

Instance Method Details

#convert(content) ⇒ Object



11
12
13
# File 'lib/blogdoor/converter.rb', line 11

def convert(content)
  @markdown.render(content)
end