class Kramdown::Converter::Base
def self.convert(tree, options = {})
4. Check if the template name starts with 'string://' and if so, strip this prefix away and
directory (the form +.convertername+ is deprecated).
3. Append +.converter_name+ to the template name and look for it in the kramdown data
file in the current working directory (the form +.convertername+ is deprecated).
2. Append +.converter_name+ (e.g. +.html+) to the template name and look for the resulting
1. Look in the current working directory for the template.
The template resolution is done in the following way (for the converter ConverterName):
the body; if evaluated after, the result is used as body. See ::apply_template.
and #apply_template_after?. If the template is evaluated before, an empty string is used for
before and/or after the tree conversion depending on the result of #apply_template_before?
If the +template+ option is specified and non-empty, the template is evaluate with ERB
+tree+ as parameter.
Initializes a new instance of the calling class and then calls the #convert method with
options that should be used.
string) and an array with warning messages. The parameter +options+ specifies the conversion
Convert the element tree +tree+ and return the resulting conversion object (normally a
def self.convert(tree, options = {}) converter = new(tree, ::Kramdown::Options.merge(options.merge(tree.options[:options] || {}))) apply_template(converter, '') if !converter.options[:template].empty? && converter.apply_template_before? result = converter.convert(tree) result.encode!(tree.options[:encoding]) if result.respond_to?(:encode!) && result.encoding != Encoding::BINARY result = apply_template(converter, result) if !converter.options[:template].empty? && converter.apply_template_after? [result, converter.warnings] end