class

Asciidoctor::Block

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

Methods for managing AsciiDoc content blocks.

Examples

block = Asciidoctor::Block.new(parent, :paragraph, source: "This is a <test>") block.content

=> "This is a <test>"

Constants

DEFAULT_CONTENT_MODEL = {:audio => ContentModel::Empty, :image => ContentModel::Empty, :listing => ContentModel::Verbatim, :literal => ContentModel::Verbatim, :open => ContentModel::Compound, :page_break => ContentModel::Empty, :pass => ContentModel::Raw, :stem => ContentModel::Raw, :thematic_break => ContentModel::Empty, :video => ContentModel::Empty}

Constructors

new(parent_block : AbstractBlock, context : Symbol, content_model : ContentModel | Nil = nil, source : String | Array(String) | Nil = nil, attributes : Hash(String, String) = {} of String => String, subs : Substitution | Nil = nil)
Source

Instance methods

content

Get the converted result of the child blocks by converting the children appropriate to content model that this block supports.

Source
document
Source
lines

The original Array content for this block.

Source
lines=(lines : Array(String))

The original Array content for this block.

Source
parent_block

The parent block.

Source
source

Returns the preprocessed source of this block.

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