module Markababy

Public Class Methods

capture(options = {}, &block) click to toggle source
# File lib/markababy.rb, line 5
def self.capture(options = {}, &block)
  [].tap { |output| markup(options.merge(:output => output), &block) }.join
end
doctype() click to toggle source
# File lib/markababy.rb, line 19
def self.doctype
  @doctype ||= "<!DOCTYPE html>\n".freeze
end
markup(options = {}, &block) click to toggle source
# File lib/markababy.rb, line 9
def self.markup(options = {}, &block)
  options[:escape] = CGI.method(:escapeHTML)

  options[:output] = $stdout unless options.has_key?(:output)

  options[:output] << doctype if options[:doctype]

  Builder.new(options, &block)
end