class Kramdown::Document
def method_missing(id, *attr, &block)
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+)$/ && (name = Utils.camelize($1)) && try_require('converter', name) && Converter.const_defined?(name) output, warnings = Converter.const_get(name).convert(@root, @options) @warnings.concat(warnings) output else super end end