The Document class represents a parsed AsciiDoc document.
Document is the root node of a parsed AsciiDoc document. It provides an
abstract syntax tree (AST) that represents the structure of the AsciiDoc
document from which the Document object was parsed.
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.
SourceInternal: Apply substitutions to the attribute value.
If the value is an inline passthrough macro (e.g., pass:<subs>[value]),
apply the substitutions defined in <subs> to the value, or leave the value
unmodified if no substitutions are specified. If the value is not an
inline passthrough macro, apply header substitutions to the value.
SourceCheck if the specified attribute is locked (set via overrides).
Sourceattribute_overrides
The attribute overrides (locked attributes).
Sourceauthors
Get the Array of authors.
Sourcebackend
The cached value of the backend attribute.
Sourcebase_dir
The String base directory for converting this document.
SourceCheck whether the current backend matches the base backend.
Sourcecatalog
The document catalog Hash.
SourceInternal: Delete any attributes stored for playback.
Sourcecompat_mode?
The Boolean AsciiDoc compatibility mode.
Sourcecontent
Get the converted result of the child blocks.
SourceConvert the AsciiDoc document using the converter.
Sourceconverter
The Converter associated with this document.
Sourceconverter=(converter : Converter::Base | Nil)
The Converter associated with this document.
SourceGet the named counter and take the next number in the sequence.
Sourcecounters
The Hash of document counters.
Sourcecreate_converter(backend_name :
String) :
Converter::Base Internal: Create and initialize an instance of the converter for this document.
Sourcecreate_converter
Create or retrieve the converter for this document.
Uses the DefaultRegistry to find a converter matching the backend.
SourceDelete the specified attribute from the document if the name is not locked.
SourceRead the docinfo file(s) for inclusion in the document template.
SourceGet the doctitle as a String.
Sourcedoctitle_as_title(separator :
String = ":") :
Title |
Nil Get the document title as a Title object.
Sourcedoctype
The cached value of the doctype attribute.
Sourceembedded?
Check if the document is embedded.
Sourceextensions
The activated Extensions::Registry associated with this document.
Sourceextensions!
Get the extensions registry, raising if nil.
Sourceextensions=(extensions : Extensions::Registry | Nil)
The activated Extensions::Registry associated with this document.
Sourceextensions?
Check if the document has extensions.
Sourcefirst_section
Get the first section of the document.
Sourceincrement_and_store_counter(counter_name :
String, block :
AbstractBlock |
Nil = nil) :
String Increment and store a counter.
Sourceinit_syntax_highlighter
Initialize the syntax highlighter based on the source-highlighter attribute.
Sourcemax_attribute_value_size
The maximum attribute value size.
Sourcemax_attribute_value_size=(max_attribute_value_size :
Int32 |
Nil)
The maximum attribute value size.
Sourcemultipart?
Check if this is a multipart (book) document.
Sourcenested?
Check if the document is nested (i.e., has a parent document).
Sourcenotitle
Check if the document should not render a title.
Sourceoptions
The Hash of resolved options.
Sourceoutfilesuffix
The outfilesuffix defined at the end of the header.
Sourceparent_document
A reference to the parent Document of this nested document.
SourceParse the AsciiDoc source stored in the Reader into an abstract syntax tree.
Sourceparsed
Whether the document has been parsed.
SourceWhether the document has been parsed.
Sourceparsed?
Check whether the source has been parsed.
SourceReplay attribute assignments at the block level.
Processes attr_entries stored in block attributes during parsing.
Sourcereader
The Reader associated with this document.
Sourcereader=(reader : Reader | Nil)
The Reader associated with this document.
SourceRegister a reference in the document catalog.
SourceResolve a string to an id.
Sourcerestore_attributes
Restore the attributes to the previously saved state (attributes in header).
Sourcesafe
A read-only integer value indicating the level of security.
Sourcesave_attributes
Internal: Branch the attributes so that the original state can be restored
at a future time.
SourceWrite the output to the specified file.
Sourcesections?
Check whether this Document has any child Section objects.
SourceSet the specified attribute on the document if the name is not locked.
Sourcesource
Make the raw source for the Document available.
Sourcesource_lines
Get the source lines of the document.
Sourcesourcemap=(sourcemap :
Bool)
Whether source map information should be tracked by the parser.
Sourcesourcemap?
Whether source map information should be tracked by the parser.
Sourcesyntax_highlighter
The SyntaxHighlighter associated with this document.
Sourcesyntax_highlighter=(syntax_highlighter : SyntaxHighlighterBase | Nil)
The SyntaxHighlighter associated with this document.
Sourceupdate_backend_attributes(new_backend :
String, init :
Bool = false) :
String |
Nil Internal: Update the backend attributes to reflect a change in the active backend.
Sourceupdate_doctype_attributes(new_doctype :
String) :
String |
Nil Internal: Update the doctype attributes to reflect a change in the active doctype.
SourceWrite the output to the specified file.
SourceGenerate cross reference text for this document.
Source