module Asciidoctor::Converter::Factory
def create backend, opts = {}
:delegate_backend - a backend String of the last converter in the {CompositeConverter} chain (optional).
:template_dirs - a String Array of directories used to instantiate a {TemplateConverter} (optional).
opts - a Hash of options to customize creation; also passed to the converter's constructor:
backend - the String backend name.
found, the built-in converter is returned or nil if no converter is found.
delegates to a {TemplateConverter} and, if found, the built-in converter. If the +:template_dirs+ key is not
+:template_dirs+ key is found in the Hash passed as the second argument, a {CompositeConverter} is created that
immediately. If a custom Converter is not found, an attempt is made to find a built-in converter. If the
If a custom Converter is found to convert the specified backend, it's instantiated (if necessary) and returned
the backend. This method accepts an optional Hash of options that are passed to the converter's constructor.
Public: Create a new Converter object that can be used to convert {AbstractNode}s to the format associated with
def create backend, opts = {} if (converter = self.for backend) converter = converter.new backend, opts if ::Class === converter if (template_dirs = opts[:template_dirs]) && BackendTraits === converter && converter.supports_templates? CompositeConverter.new backend, (TemplateConverter.new backend, template_dirs, opts), converter, backend_traits_source: converter else converter end elsif (template_dirs = opts[:template_dirs]) if (delegate_backend = opts[:delegate_backend]) && (converter = self.for delegate_backend) converter = converter.new delegate_backend, opts if ::Class === converter CompositeConverter.new backend, (TemplateConverter.new backend, template_dirs, opts), converter, backend_traits_source: converter else TemplateConverter.new backend, template_dirs, opts end end end