class Crst::Directive

Overview

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.

Defined in:

crst/nodes.cr

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

def arguments : Array(String) #

Positional arguments to the directive


[View source]
def arguments=(arguments : Array(String)) #

Positional arguments to the directive


[View source]
def children : Array(Crst::Node) #

Child nodes (content within the directive)


[View source]
def children=(children : Array(Crst::Node)) #

Child nodes (content within the directive)


[View source]
def name : String #

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


[View source]
def name=(name : String) #

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


[View source]
def options : Hash(String, String) #

Option key-value pairs


[View source]
def options=(options : Hash(String, String)) #

Option key-value pairs


[View source]