Class: Awestruct::Handlers::TextileHandler
Constant Summary
collapse
- CHAIN =
Awestruct::HandlerChain.new( /\.textile$/,
Awestruct::Handlers::FileHandler,
Awestruct::Handlers::FrontMatterHandler,
Awestruct::Handlers::InterpolationHandler,
Awestruct::Handlers::TextileHandler,
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
#initialize(site, delegate) ⇒ TextileHandler
Returns a new instance of TextileHandler.
24
25
26
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 24
def initialize(site, delegate)
super( site, delegate )
end
|
Instance Method Details
#content_syntax ⇒ Object
40
41
42
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 40
def content_syntax
:textile
end
|
#output_extension ⇒ Object
36
37
38
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 36
def output_extension
'.html'
end
|
#output_filename ⇒ Object
32
33
34
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 32
def output_filename
File.basename( relative_source_path, '.textile' ) + '.html'
end
|
#rendered_content(context, with_layouts = true) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 44
def rendered_content(context, with_layouts=true)
rendered = ''
restrictions = (site.textile || []).map { |r| r.to_sym }
rules = context.site.textile_rules ? context.site.textile_rules.map { |r| r.to_sym } : []
RedCloth.new( delegate.rendered_content( context, with_layouts ), restrictions ).to_html(*rules)
end
|
#simple_name ⇒ Object
28
29
30
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 28
def simple_name
File.basename( relative_source_path, '.textile' )
end
|