class Kramdown::Document
kramdown.
The second argument to the #new method is an options hash for customizing the behaviour of
added later, there may be additional shortcut methods.
The #to_html method is a shortcut for using the Converter::ToHtml class. If other converters are
puts doc.to_html
doc = Kramdown::Document.new(‘This is some kramdown text’)
require ‘kramdown’
formats. Use it like this:
This class provides a one-stop-shop for using kramdown to convert text into various output
The main interface to kramdown.
def initialize(source, options = {}, ext = nil)
The parameter +ext+ can be used to set a custom extension class. Note that the default
kramdown parser sothat after this call the output can be generated.
DEFAULT_OPTIONS for a list of available options). The +source+ is immediately parsed by the
Create a new Kramdown document from the string +source+ and use the provided +options+ (see
def initialize(source, options = {}, ext = nil) @options = DEFAULT_OPTIONS.merge(options) @warnings = [] @parse_infos = {} @extension = extension || Kramdown::Extension.new @tree = Parser::Kramdown.parse(source, self) end
def inspect #:nodoc:
def inspect #:nodoc: "<KD:Document: options=#{@options.inspect} tree=#{@tree.inspect} warnings=#{@warnings.inspect}>" end
def to_html
def to_html Converter::Html.convert(self) end