Class: Awestruct::Handlers::MarkdownHandler
Constant Summary
collapse
- CHAIN =
Awestruct::HandlerChain.new( /\.md$/,
Awestruct::Handlers::FileHandler,
Awestruct::Handlers::FrontMatterHandler,
Awestruct::Handlers::InterpolationHandler,
Awestruct::Handlers::MarkdownHandler,
Awestruct::Handlers::LayoutHandler
)
Instance Attribute Summary
Attributes inherited from BaseHandler
#delegate, #site
Instance Method Summary
collapse
Methods inherited from BaseHandler
#content_line_offset, #dependencies, #execute_shell, #front_matter, #inherit_front_matter, #input_mtime, #output_path, #path, #raw_content, #relative_source_path, #stale?, #to_chain
Constructor Details
Returns a new instance of MarkdownHandler.
23
24
25
|
# File 'lib/awestruct/handlers/markdown_handler.rb', line 23
def initialize(site, delegate)
super( site, delegate )
end
|
Instance Method Details
#content_syntax ⇒ Object
39
40
41
|
# File 'lib/awestruct/handlers/markdown_handler.rb', line 39
def content_syntax
:markdown
end
|
#output_extension ⇒ Object
35
36
37
|
# File 'lib/awestruct/handlers/markdown_handler.rb', line 35
def output_extension
'.html'
end
|
#output_filename ⇒ Object
31
32
33
|
# File 'lib/awestruct/handlers/markdown_handler.rb', line 31
def output_filename
File.basename( relative_source_path, '.md' ) + '.html'
end
|
#rendered_content(context, with_layouts = true) ⇒ Object
43
44
45
46
|
# File 'lib/awestruct/handlers/markdown_handler.rb', line 43
def rendered_content(context, with_layouts=true)
doc = RDiscount.new( delegate.rendered_content( context, with_layouts ) )
doc.to_html
end
|
#simple_name ⇒ Object
27
28
29
|
# File 'lib/awestruct/handlers/markdown_handler.rb', line 27
def simple_name
File.basename( relative_source_path, '.md' )
end
|