class Kramdown::Document

def method_missing(id, *attr, &block)

For example, +to_html+ would instantiate the Kramdown::Converter::Html class.

class (i.e. a class in the Kramdown::Converter module) and use it for converting the document.
Check if a method is invoked that begins with +to_+ and if so, try to instantiate a converter
def method_missing(id, *attr, &block)
  if id.to_s =~ /^to_(\w+)$/
    Converter.const_get($1.capitalize).convert(self)
  else
    super
  end
end