Class: Mdoc::Writer
- Inherits:
-
Object
- Object
- Mdoc::Writer
- Defined in:
- lib/mdoc/writer.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#tilt ⇒ Object
Returns the value of attribute tilt.
Instance Method Summary collapse
Instance Attribute Details
#tilt ⇒ Object
Returns the value of attribute tilt.
5 6 7 |
# File 'lib/mdoc/writer.rb', line 5 def tilt @tilt end |
Instance Method Details
#default_processors ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/mdoc/writer.rb', line 18 def default_processors %w[ add_toc add_title smart_code_block expand_link ] end |
#out(doc) ⇒ Object
7 8 9 |
# File 'lib/mdoc/writer.rb', line 7 def out(doc) Mdoc.opts.no_output ? $stdout : File.new(doc.out_file, 'wb') end |
#process!(doc) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/mdoc/writer.rb', line 11 def process!(doc) @tilt = Tilt::ERBTemplate.new(doc.tpl_file) oh = out(doc) oh.write @tilt.render(doc) oh.close unless oh == $stdout end |