Class AsciiDocModel
java.lang.Object
pro.verron.asciidoc.core.AsciiDocModel
Represents a minimal in-memory model of an AsciiDoc document.
This model intentionally supports a compact subset sufficient for rendering to WordprocessingML and JavaFX Scene:
- Headings (levels 1..6) using leading
=markers - Paragraphs separated by blank lines
- Inline emphasis for bold and italic using AsciiDoc-like markers:
*bold*,_italic_
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Returns the document attribute by name.Returns the document attributes.Returns the ordered list of blocks comprising the document.static AsciiDocModelCreates a newAsciiDocModelfrom the provided blocks.static AsciiDocModelCreates a newAsciiDocModelfrom the provided attributes and blocks.static AsciiDocModelCreates a newAsciiDocModelfrom the provided attributes and varargs blocks.static AsciiDocModelCreates a newAsciiDocModelfrom the provided varargs blocks.
-
Method Details
-
of
Creates a newAsciiDocModelfrom the provided blocks.- Parameters:
blocks- ordered content blocks- Returns:
- immutable AsciiDocModel
-
of
Creates a newAsciiDocModelfrom the provided attributes and blocks.- Parameters:
attributes- document attributesblocks- ordered content blocks- Returns:
- immutable AsciiDocModel
-
of
Creates a newAsciiDocModelfrom the provided attributes and varargs blocks.- Parameters:
attributes- document attributesblocks- ordered content blocks- Returns:
- immutable AsciiDocModel
-
of
Creates a newAsciiDocModelfrom the provided varargs blocks.- Parameters:
blocks- ordered content blocks- Returns:
- immutable AsciiDocModel
-
getBlocks
-
getAttributes
-
getAttribute
Returns the document attribute by name.- Parameters:
name- attribute name- Returns:
- the attribute value wrapped in
Optional, orOptional.empty()
-