class Asciidoctor::Converter::BuiltIn

An abstract base class for built-in {Converter} classes.

Public Class Methods

new(backend, opts = {}) click to toggle source
# File lib/asciidoctor/converter/base.rb, line 16
def initialize backend, opts = {}
end

Public Instance Methods

content(node) click to toggle source

Public: Returns the converted content of the {AbstractNode}.

Returns the converted [String] content of the {AbstractNode}.

# File lib/asciidoctor/converter/base.rb, line 41
def content node
  node.content
end
Also aliased as: pass
convert(node, transform = nil, opts = {}) click to toggle source

Public: Converts the specified {AbstractNode} using the specified transform and optionally additional options (when not empty).

CAUTION: Method that handles the specified transform *may not* accept the second argument with additional options, in which case an {ArgumentError} is raised if the given opts Hash is not nil. The additional options are used in template-based backends to access convert helper methods such as outline.

See {Converter#convert} for more details.

Returns the [String] result of conversion

# File lib/asciidoctor/converter/base.rb, line 31
def convert node, transform = nil, opts = {}
  transform ||= node.node_name
  opts.empty? ? (send transform, node) : (send transform, node, opts)
end
pass(node)
Alias for: content
skip(node) click to toggle source

Public: Skips conversion of the {AbstractNode}.

Returns [NilClass]

# File lib/asciidoctor/converter/base.rb, line 50
def skip node
  nil
end