class
Crst::Directive
- Crst::Directive
- Crst::Node
- Reference
- Object
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.crConstructors
Instance Method Summary
-
#arguments : Array(String)
Positional arguments to the directive
-
#arguments=(arguments : Array(String))
Positional arguments to the directive
-
#children : Array(Crst::Node)
Child nodes (content within the directive)
-
#children=(children : Array(Crst::Node))
Child nodes (content within the directive)
-
#name : String
The directive name (e.g., "code-block", "image", "note")
-
#name=(name : String)
The directive name (e.g., "code-block", "image", "note")
-
#options : Hash(String, String)
Option key-value pairs
-
#options=(options : Hash(String, String))
Option key-value pairs
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)
#