Class: Awestruct::Handlers::TextileHandler
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) ⇒ TextileHandler
Returns a new instance of TextileHandler.
9
10
11
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 9
def initialize(site, delegate)
super( site, delegate )
end
|
Instance Method Details
#content_syntax ⇒ Object
25
26
27
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 25
def content_syntax
:textile
end
|
#output_extension ⇒ Object
21
22
23
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 21
def output_extension
'.html'
end
|
#output_filename ⇒ Object
17
18
19
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 17
def output_filename
File.basename( relative_source_path, '.textile' ) + '.html'
end
|
#rendered_content(context, with_layouts = true) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 29
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
13
14
15
|
# File 'lib/awestruct/handlers/textile_handler.rb', line 13
def simple_name
File.basename( relative_source_path, '.textile' )
end
|