Class: Asciidoctor::TemplatesCompiler::Base
- Inherits:
-
Object
- Object
- Asciidoctor::TemplatesCompiler::Base
- Defined in:
- lib/asciidoctor/templates_compiler/base.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #compile_converter(output: StringIO.new, templates_dir:, pretty: false, **opts) ⇒ Object (also: #call)
Class Method Details
.call ⇒ Object
14 15 16 |
# File 'lib/asciidoctor/templates_compiler/base.rb', line 14 def compile_converter(**opts) new.compile_converter(**opts) end |
.compile_converter(**opts) ⇒ Object
10 11 12 |
# File 'lib/asciidoctor/templates_compiler/base.rb', line 10 def compile_converter(**opts) new.compile_converter(**opts) end |
Instance Method Details
#compile_converter(output: StringIO.new, templates_dir:, pretty: false, **opts) ⇒ Object Also known as: call
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/asciidoctor/templates_compiler/base.rb', line 17 def compile_converter(output: StringIO.new, templates_dir:, pretty: false, **opts) unless Dir.exist? templates_dir raise "Templates directory '#{templates_dir}' does not exist" end backend_info = opts[:backend_info] || {} templates = find_templates(templates_dir) transforms_code = compile_templates(templates, backend_info: backend_info, pretty: pretty) generate_class(output: output, transforms_code: transforms_code, helpers_code: read_helpers(templates_dir), **opts) end |