Class: Awestruct::Handlers::MarkdownHandler

Inherits:
BaseHandler
  • Object
show all
Defined in:
lib/awestruct/handlers/markdown_handler.rb

Instance Attribute Summary

Attributes inherited from BaseHandler

#delegate, #site

Instance Method Summary collapse

Methods inherited from BaseHandler

#content_line_offset, #front_matter, #inherit_front_matter, #input_mtime, #output_path, #path, #raw_content, #relative_source_path, #stale?, #to_chain

Constructor Details

#initialize(site, delegate) ⇒ MarkdownHandler

Returns a new instance of MarkdownHandler.



9
10
11
# File 'lib/awestruct/handlers/markdown_handler.rb', line 9

def initialize(site, delegate)
  super( site, delegate )
end

Instance Method Details

#content_syntaxObject



25
26
27
# File 'lib/awestruct/handlers/markdown_handler.rb', line 25

def content_syntax
  :markdown
end

#output_extensionObject



21
22
23
# File 'lib/awestruct/handlers/markdown_handler.rb', line 21

def output_extension
  '.html'
end

#output_filenameObject



17
18
19
# File 'lib/awestruct/handlers/markdown_handler.rb', line 17

def output_filename
  File.basename( relative_source_path, '.md' ) + '.html'
end

#rendered_content(context, with_layouts = true) ⇒ Object



29
30
31
32
# File 'lib/awestruct/handlers/markdown_handler.rb', line 29

def rendered_content(context, with_layouts=true)
  doc = RDiscount.new( raw_content )
  doc.to_html
end

#simple_nameObject



13
14
15
# File 'lib/awestruct/handlers/markdown_handler.rb', line 13

def simple_name
  File.basename( relative_source_path, '.md' ) 
end