class

Asciidoctor::Section

Inherits Asciidoctor::AbstractBlock < Asciidoctor::Substitutors < Asciidoctor::AbstractNode < Asciidoctor::Logging < Reference < Object

Methods for managing sections of AsciiDoc content in a document. The section responds as an Array of content blocks by delegating block-related methods to its @blocks Array.

Constructors

new(document : Document, parent : AbstractBlock | Nil = nil, level : Int32 | Nil = nil, numbered : Bool = false, attributes : Hash(String, String) = {} of String => String)
Source

Class methods

generate_id(title : String, document : Document) : String

Generate a String id from the given section title and document. If the generated id already exists in the document catalog, a numeric suffix is appended to make it unique (e.g., _my_section_2).

Source

Instance methods

<<(block : AbstractBlock) : self

Append a content block to this block's list of blocks. If the child block is a Section, assign an index to it.

Source
document
Source
generate_id

Generate a String id for this section based on its title.

Source
index

The 0-based index order of this section within the parent block.

Source
index=(index : Int32)

The 0-based index order of this section within the parent block.

Source
name

The name of this section, an alias of the section title.

Source
numbered

Flag to indicate whether this section should be numbered.

Source
numbered=(numbered : Bool)

Flag to indicate whether this section should be numbered.

Source
parent_block

The parent block.

Source
sections?

Check whether this Section has any child Section objects.

Source
sectname

The section name of this section.

Source
sectname=(sectname : String | Nil)

The section name of this section.

Source
sectnum(delimiter : String = ".", append : String | Nil = nil) : String

Get the section number for the current Section.

The section number is a dot-separated String that uniquely describes the position of this Section in the document.

Source
special

Flag to indicate whether this is a special section or a child of one.

Source
special=(special : Bool)

Flag to indicate whether this is a special section or a child of one.

Source
special?
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
xreftext(xrefstyle : String | Nil = nil) : String | Nil

Generate cross reference text (xreftext) that can be used to refer to this section.

Source