class

Crst::Directive

Inherits Crst::Node < Reference < Object

Represents a directive block

Directives are special RST constructs starting with .. directive::. They provide extensible syntax for special document elements like code blocks, admonitions, images, and custom directives.

Example:

# RST code-block directive:
# .. code-block:: crystal
#
#    puts "Hello"

directive = Crst::Directive.new("code-block", ["crystal"])
directive.options["linenos"] = "true"

NOTE: See the RST specification for the full list of standard directives.

Constructors

new(name : String, arguments : Array(String) = [] of String, options : Hash(String, String) = {} of String => String, children : Array(Crst::Node) = [] of Node)
Source

Instance methods

arguments

Positional arguments to the directive

Source
arguments=(arguments : Array(String))

Positional arguments to the directive

Source
children

Child nodes (content within the directive)

Source
children=(children : Array(Crst::Node))

Child nodes (content within the directive)

Source
name

The directive name (e.g., "code-block", "image", "note")

Source
name=(name : String)

The directive name (e.g., "code-block", "image", "note")

Source
options

Option key-value pairs

Source
options=(options : Hash(String, String))

Option key-value pairs

Source