Class: Asciibook::Converter
- Inherits:
-
Asciidoctor::Converter::Base
- Object
- Asciidoctor::Converter::Base
- Asciibook::Converter
- Defined in:
- lib/asciibook/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.
7 8 9 10 11 12 |
# File 'lib/asciibook/converter.rb', line 7 def initialize(backend, = {}) super init_backend_traits outfilesuffix: '.html', basebackend: 'html' @template_dirs = ([:template_dirs] || []).unshift(DEFAULT_TEMPLATE_PATH) @templates = {} end |
Instance Method Details
#convert(node, transform = node.node_name, options = {}) ⇒ Object
14 15 16 |
# File 'lib/asciibook/converter.rb', line 14 def convert(node, transform = node.node_name, = {}) get_template(transform).render 'node' => node_to_hash(node) end |