Class JRubyProcessor
java.lang.Object
org.asciidoctor.jruby.extension.internal.JRubyProcessor
- All Implemented Interfaces:
Processor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateBlock
(StructuralNode parent, String context, String content) createBlock
(StructuralNode parent, String context, String content, Map<String, Object> attributes) createBlock
(StructuralNode parent, String context, String content, Map<String, Object> attributes, Map<Object, Object> options) createBlock
(StructuralNode parent, String context, List<String> content) createBlock
(StructuralNode parent, String context, List<String> content, Map<String, Object> attributes) createBlock
(StructuralNode parent, String context, List<String> content, Map<String, Object> attributes, Map<Object, Object> options) createBlock
(StructuralNode parent, String context, Map<Object, Object> options) createDocument
(Document parentDocument) Creates an inner document for the given parent document.createList
(StructuralNode parent, String context) Creates a new List.createList
(StructuralNode parent, String context, Map<Object, Object> options) Creates a new List.createList
(StructuralNode parent, String context, Map<String, Object> attributes, Map<Object, Object> options) Creates a new List.createListItem
(DescriptionList parent, String text) createListItem
(List parent, String text) createPhraseNode
(ContentNode parent, String context, String text) createPhraseNode
(ContentNode parent, String context, String text, Map<String, Object> attributes) createPhraseNode
(ContentNode parent, String context, String text, Map<String, Object> attributes, Map<String, Object> options) createPhraseNode
(ContentNode parent, String context, List<String> text) createPhraseNode
(ContentNode parent, String context, List<String> text, Map<String, Object> attributes) createPhraseNode
(ContentNode parent, String context, List<String> text, Map<String, Object> attributes, Map<Object, Object> options) createSection
(StructuralNode parent) createSection
(StructuralNode parent, boolean numbered, Map<Object, Object> options) createSection
(StructuralNode parent, int level, boolean numbered, Map<Object, Object> options) createSection
(StructuralNode parent, Integer level, boolean numbered, Map<Object, Object> options) createSection
(StructuralNode parent, Map<Object, Object> options) createTable
(StructuralNode parent) createTable
(StructuralNode parent, Map<String, Object> attributes) createTableCell
(Column column, String text) createTableCell
(Column column, Document innerDocument) createTableColumn
(Table parent, int index) createTableColumn
(Table parent, int index, Map<String, Object> attributes) createTableRow
(Table parent) void
void
parseContent
(StructuralNode parent, List<String> lines) Parses the given raw asciidoctor content, parses it and appends it as children to the given parent block.void
setAsciidoctor
(JRubyAsciidoctor asciidoctor) final void
final void
<T> T
final void
updateConfig
(Map<String, Object> config)
-
Field Details
-
CONTENT_MODEL_EMPTY
- See Also:
-
config
-
-
Constructor Details
-
JRubyProcessor
public JRubyProcessor() -
JRubyProcessor
-
-
Method Details
-
getConfig
-
setConfig
-
updateConfig
- Specified by:
updateConfig
in interfaceProcessor
-
setConfigFinalized
public final void setConfigFinalized() -
createTable
- Specified by:
createTable
in interfaceProcessor
-
createTable
- Specified by:
createTable
in interfaceProcessor
-
createTableRow
- Specified by:
createTableRow
in interfaceProcessor
-
createTableColumn
- Specified by:
createTableColumn
in interfaceProcessor
-
createTableCell
- Specified by:
createTableCell
in interfaceProcessor
-
createTableCell
- Specified by:
createTableCell
in interfaceProcessor
-
createBlock
public Block createBlock(StructuralNode parent, String context, String content, Map<String, Object> attributes, Map<Object, Object> options) - Specified by:
createBlock
in interfaceProcessor
-
createBlock
public Block createBlock(StructuralNode parent, String context, List<String> content, Map<String, Object> attributes, Map<Object, Object> options) - Specified by:
createBlock
in interfaceProcessor
-
createPhraseNode
public PhraseNode createPhraseNode(ContentNode parent, String context, List<String> text, Map<String, Object> attributes, Map<Object, Object> options) - Specified by:
createPhraseNode
in interfaceProcessor
-
createPhraseNode
public PhraseNode createPhraseNode(ContentNode parent, String context, String text, Map<String, Object> attributes, Map<String, Object> options) - Specified by:
createPhraseNode
in interfaceProcessor
-
createBlock
- Specified by:
createBlock
in interfaceProcessor
-
createSection
public Section createSection(StructuralNode parent, Integer level, boolean numbered, Map<Object, Object> options) - Specified by:
createSection
in interfaceProcessor
-
createDocument
Creates an inner document for the given parent document. Inner documents are used for tables cells with styleasciidoc
.- Specified by:
createDocument
in interfaceProcessor
- Parameters:
parentDocument
- The parent document of the new document.- Returns:
- A new inner document.
-
createList
Description copied from interface:Processor
Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.- Specified by:
createList
in interfaceProcessor
- Parameters:
parent
- The block to which the parsed content should be added as children.context
- Either"olist"
,ulist
,colist
ordlist
- Returns:
- A List node that can be added to the AST of a document.
-
createList
public List createList(StructuralNode parent, String context, Map<String, Object> attributes, Map<Object, Object> options) Description copied from interface:Processor
Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.- Specified by:
createList
in interfaceProcessor
- Parameters:
parent
- The block to which the parsed content should be added as children.context
- Either"olist"
,ulist
,colist
ordlist
attributes
- Additional attributes to be set on the new list node, e.g.Collections.singletonMap("start", "2")
.options
- Additional options to be set on the new list node.- Returns:
- A List node that can be added to the AST of a document.
-
createList
Description copied from interface:Processor
Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.- Specified by:
createList
in interfaceProcessor
- Parameters:
parent
- The block to which the parsed content should be added as children.context
- Either"olist"
,ulist
,colist
ordlist
options
- Additional options to be set on the new list node.- Returns:
- A List node that can be added to the AST of a document.
-
createListItem
- Specified by:
createListItem
in interfaceProcessor
-
createListItem
- Specified by:
createListItem
in interfaceProcessor
-
parseContent
Parses the given raw asciidoctor content, parses it and appends it as children to the given parent block.The following example will add two paragraphs with the role
newcontent
to all top level sections of a document:Asciidoctor asciidoctor = ... asciidoctor.javaExtensionRegistry().treeprocessor(new Treeprocessor() { DocumentRuby process(DocumentRuby document) { for (AbstractBlock block: document.getBlocks()) { if (block instanceof Section) { parseContent(block, Arrays.asList(new String[]{ "[newcontent]", "This is new content" "", "[newcontent]", "This is also new content"})); } } } }); - Specified by:
parseContent
in interfaceProcessor
- Parameters:
parent
- The block to which the parsed content should be added as children.lines
- Raw asciidoctor content
-
createTableColumn
- Specified by:
createTableColumn
in interfaceProcessor
-
createTableCell
- Specified by:
createTableCell
in interfaceProcessor
-
createTableCell
- Specified by:
createTableCell
in interfaceProcessor
-
createBlock
- Specified by:
createBlock
in interfaceProcessor
-
createBlock
public Block createBlock(StructuralNode parent, String context, String content, Map<String, Object> attributes) - Specified by:
createBlock
in interfaceProcessor
-
createBlock
- Specified by:
createBlock
in interfaceProcessor
-
createBlock
public Block createBlock(StructuralNode parent, String context, List<String> content, Map<String, Object> attributes) - Specified by:
createBlock
in interfaceProcessor
-
createSection
- Specified by:
createSection
in interfaceProcessor
-
createSection
- Specified by:
createSection
in interfaceProcessor
-
createSection
- Specified by:
createSection
in interfaceProcessor
-
createSection
public Section createSection(StructuralNode parent, int level, boolean numbered, Map<Object, Object> options) - Specified by:
createSection
in interfaceProcessor
-
createPhraseNode
- Specified by:
createPhraseNode
in interfaceProcessor
-
createPhraseNode
public PhraseNode createPhraseNode(ContentNode parent, String context, List<String> text, Map<String, Object> attributes) - Specified by:
createPhraseNode
in interfaceProcessor
-
createPhraseNode
- Specified by:
createPhraseNode
in interfaceProcessor
-
createPhraseNode
public PhraseNode createPhraseNode(ContentNode parent, String context, String text, Map<String, Object> attributes) - Specified by:
createPhraseNode
in interfaceProcessor
-
getAsciidoctor
-
setAsciidoctor
-
unwrap
-
log
-