class Mdoc::Writer

Attributes

tilt[RW]

Public Instance Methods

default_processors() click to toggle source
# File lib/mdoc/writer.rb, line 18
def default_processors
  %w[
    add_toc
    add_title
    smart_code_block
    expand_link
  ]
end
out(doc) click to toggle source
# File lib/mdoc/writer.rb, line 7
def out(doc)
  Mdoc.opts.no_output ? $stdout : File.new(doc.out_file, 'wb')
end
process!(doc) click to toggle source
# 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