lib/asciidoctor/templates_compiler/converter_generator.rb
def generate(out = StringIO.new)
      out << head_code << "\n"
      out << helpers_code << "\n" unless @helpers_code.blank?
      out << initialization_code << "\n"
      out << convert_method_code << "\n"
      transform_methods_code(out)
      out << support_methods_code << "\n"
      out << tail_code
      out
    end
def generate(out = StringIO.new)
      out << head_code << "\n"
      out << helpers_code << "\n" unless @helpers_code.blank?
      out << initialization_code << "\n"
      out << convert_method_code << "\n"
      transform_methods_code(out)
      out << support_methods_code << "\n"
      out << tail_code
      out
    end
def generate ( out = StringIO . new ) out << head_code << "\n" out << helpers_code << "\n" unless @helpers_code . blank? out << initialization_code << "\n" out << convert_method_code << "\n" transform_methods_code ( out ) out << support_methods_code << "\n" out << tail_code out end
@param class_name [String] full name of the converter class to generate
   (e.g. +My::HTML::Converter+).
 @param transforms_code [#each] enumerable that yields pair: transform name ()
 @param helpers_code [String, nil] source code to include in the generated class. It must
   contain a module named +Helpers+.
 @param register_for [Array<String>] an array of backend names that the generated converter
   should be registered for to handle. Default is empty.
 @param backend_info [Hash] a hash of parameters for +backend_info+: +basebackend+,
   +outfilesuffix+, +filetype+, +htmlsyntax+, +supports_templates+. Default is empty.
 @param delegate_backend [String, nil] name of the backend (converter) to use as a fallback
   for AST nodes not supported by the generated converter. If not specified, no fallback will
   be used and converter will raise +NoMethodError+ when it try to convert unsupported node.
 @param ignore_convert_opts [Boolean] ignore (i.e. do not set as local variables) options
   passed to the +#convert+ method (i.e. to the templates). This is needed only for Opal.

 @raise [ArgumentError] if _helpers_code_ is not blank and does not contain module +Helpers+.


 Generates source code of a converter class for Asciidoctor.

 @param out [#<<] output stream where to write the generated class.
 @return the given _out_ stream.
@param class_name [ String ] full name of the converter class to generate ( e . g . + My :: HTML :: Converter + ) . @param transforms_code [ #each ] enumerable that yields pair : transform name () @param helpers_code [ String nil ] source code to include in the generated class . It must contain a module named + Helpers + . @param register_for [ Array<String > ] an array of backend names that the generated converter should be registered for to handle . Default is empty . @param backend_info [ Hash ] a hash of parameters for + backend_info + : + basebackend + + outfilesuffix + + filetype + + htmlsyntax + + supports_templates + . Default is empty . @param delegate_backend [ String nil ] name of the backend ( converter ) to use as a fallback for AST nodes not supported by the generated converter . If not specified no fallback will be used and converter will raise + NoMethodError + when it try to convert unsupported node . @param ignore_convert_opts [ Boolean ] ignore ( i . e . do not set as local variables ) options passed to the + #convert + method ( i . e . to the templates ) . This is needed only for Opal .