Class: Asciidoctor::Htmlbook::Converter
- Inherits:
-
Converter::Base
- Object
- Converter::Base
- Asciidoctor::Htmlbook::Converter
- Defined in:
- lib/asciidoctor/htmlbook/converter.rb
Constant Summary collapse
- DEFAULT_TEMPLATE_PATH =
File.('../../../../templates', __FILE__)
Instance Method Summary collapse
- #convert(node, transform = node.node_name, options = {}) ⇒ Object
-
#initialize(backend, options = {}) ⇒ Converter
constructor
A new instance of Converter.
Constructor Details
#initialize(backend, options = {}) ⇒ Converter
Returns a new instance of Converter.
8 9 10 11 12 13 |
# File 'lib/asciidoctor/htmlbook/converter.rb', line 8 def initialize(backend, = {}) super init_backend_traits outfilesuffix: '.html' @template_dirs = ([:template_dirs] || []).unshift(DEFAULT_TEMPLATE_PATH) @templates = {} end |
Instance Method Details
#convert(node, transform = node.node_name, options = {}) ⇒ Object
15 16 17 |
# File 'lib/asciidoctor/htmlbook/converter.rb', line 15 def convert(node, transform = node.node_name, = {}) get_template(transform).render 'node' => node_to_hash(node) end |