class

Asciidoctor::AbstractNode

Inherits Asciidoctor::Logging < Reference < Object

An abstract base class that provides state and methods for managing a node of AsciiDoc content. The state and methods on this class are common to all content segments in an AsciiDoc document.

Constructors

new(context : Symbol, attributes : Hash(String, String) = {} of String => String)
Source

Instance methods

add_role(name : String) : Bool

Adds the given role directly to this node.

Source
attr(name : String, default_value : String | Nil = nil, fallback_name : String | Bool | Nil = nil) : String | Nil

Get the value of the specified attribute. If the attribute is not found on this node, fallback_name is set, and this node is not the Document node, get the value from the Document node.

Source
attr?(name : String, expected_value : String | Nil = nil, fallback_name : String | Bool | Nil = nil) : Bool

Check if the specified attribute is defined, optionally performing a comparison with the expected value.

Source
attributes

The Hash of attributes for this node.

Source
block?
Source
context

The Symbol context for this node.

Source
converter

Get the Converter instance associated with this node.

Source
document
Source
enabled_options

Retrieve the Set of option names that are enabled on this node.

Source
has_role?(name : String) : Bool

Checks if the specified role is present in the list of roles for this node.

Source
icon_uri(name : String) : String

Construct a URI reference to the target icon.

Source
id

The String id of this node.

Source
id=(id : String | Nil)

The String id of this node.

Source
image_uri(target_image : String, asset_dir_key : String = "imagesdir") : String

Construct a URI reference to the target image.

Source
inline?
Source
is_uri?(str : String) : Bool

Check if the specified string is a URI by checking for a URI scheme.

Source
media_uri(target : String, asset_dir_key : String = "imagesdir") : String

Construct a URI reference to the target media.

Source
node_name

The String name of this node.

Source
normalize_system_path(target : String, start : String | Nil = nil, jail : String | Nil = nil) : String

Resolve and normalize a system path from the target and start paths.

Source
normalize_web_path(target : String, start : String | Nil = nil) : String

Resolve and normalize a web path from the target and start paths.

Source
option?(name : String) : Bool

Check if the specified option attribute is enabled on the current node.

Source
parent

The parent AbstractNode of this node.

Source
parent=(parent : AbstractNode | Nil)

The parent AbstractNode of this node.

Source
reftext

A convenience method that returns the value of the reftext attribute.

Source
reftext?

A convenience method that checks if the reftext attribute is defined.

Source
remove_attr(name : String) : String | Nil

Remove the attribute from the current node.

Source
remove_role(name : String) : Bool

Removes the given role directly from this node.

Source
role

Retrieves the space-separated String role for this node.

Source
role=(names : String | Array(String))

Sets the value of the role attribute on this node.

Source
role?(expected_value : String | Nil = nil) : Bool

Checks if the role attribute is set on this node and, if an expected value is given, whether the space-separated role matches that value.

Source
roles

Retrieves the String role names for this node as an Array.

Source
set_attr(name : String, value : String = "", overwrite : Bool = true) : Bool

Assign the value to the attribute name for the current node.

Source
set_option(name : String) : Nil

Set the specified option on this node.

Source
update_attributes(new_attributes : Hash(String, String)) : Hash(String, String)

Update the attributes of this node with the new values.

Source