class Asciidoctor::Inline
Public: Methods for managing inline elements in AsciiDoc block
Attributes
Public: Get/Set the target (e.g., uri) of this inline element
Public: Get the text of this inline element
Public: Get the type (qualifier) of this inline element
Public Class Methods
# File lib/asciidoctor/inline.rb, line 13 def initialize(parent, context, text = nil, opts = {}) super(parent, context, opts) @node_name = %(inline_#{context}) @text = text @id = opts[:id] @type = opts[:type] @target = opts[:target] end
Public Instance Methods
Public: Returns the converted alt text for this inline image.
Returns the [String] value of the alt attribute.
# File lib/asciidoctor/inline.rb, line 40 def alt (attr 'alt') || '' end
# File lib/asciidoctor/inline.rb, line 22 def block? false end
# File lib/asciidoctor/inline.rb, line 30 def convert converter.convert self end
# File lib/asciidoctor/inline.rb, line 26 def inline? true end
For a reference node (:ref or :bibref), the text is the reftext (and the reftext attribute is not set).
(see Asciidoctor::AbstractNode#reftext)
# File lib/asciidoctor/inline.rb, line 54 def reftext (val = @text) ? (apply_reftext_subs val) : nil end
For a reference node (:ref or :bibref), the text is the reftext (and the reftext attribute is not set).
(see Asciidoctor::AbstractNode#reftext?)
# File lib/asciidoctor/inline.rb, line 47 def reftext? @text && (@type == :ref || @type == :bibref) end
Public: Generate cross reference text (xreftext) that can be used to refer to this inline node.
Use the explicit reftext for this inline node, if specified, retrieved by calling the reftext method. Otherwise, returns nil.
xrefstyle - Not currently used (default: nil).
Returns the [String] reftext to refer to this inline node or nothing if no reftext is defined.
# File lib/asciidoctor/inline.rb, line 68 def xreftext xrefstyle = nil reftext end