Package org.asciidoctor.extension
Interface Processor
- All Known Implementing Classes:
BaseProcessor
,BlockMacroProcessor
,BlockProcessor
,DocinfoProcessor
,IncludeProcessor
,InlineMacroProcessor
,JRubyProcessor
,MacroProcessor
,Postprocessor
,Preprocessor
,Treeprocessor
public interface Processor
-
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
<T> T
void
updateConfig
(Map<String, Object> config)
-
Method Details
-
createTable
-
createTable
-
createTableRow
-
createTableColumn
-
createTableColumn
-
createTableCell
-
createTableCell
-
createTableCell
-
createTableCell
-
createBlock
-
createBlock
-
createBlock
-
createBlock
-
createBlock
-
createBlock
-
createSection
-
createSection
-
createSection
-
createSection
Section createSection(StructuralNode parent, int level, boolean numbered, Map<Object, Object> options) -
createPhraseNode
-
createPhraseNode
PhraseNode createPhraseNode(ContentNode parent, String context, List<String> text, Map<String, Object> attributes) -
createPhraseNode
-
createPhraseNode
-
createPhraseNode
PhraseNode createPhraseNode(ContentNode parent, String context, String text, Map<String, Object> attributes) -
createPhraseNode
PhraseNode createPhraseNode(ContentNode parent, String context, String text, Map<String, Object> attributes, Map<String, Object> options) -
createBlock
-
createSection
-
createDocument
Creates an inner document for the given parent document. Inner documents are used for tables cells with styleasciidoc
.- Parameters:
parentDocument
- The parent document of the new document.- Returns:
- A new inner document.
-
createList
Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.- 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
List createList(StructuralNode parent, String context, Map<String, Object> attributes, Map<Object, Object> options) Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.- 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
Creates a new List. This method is experimental and may change in future minor releases until declared to be stable.- 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
-
createListItem
-
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"})); } } } }); - Parameters:
parent
- The block to which the parsed content should be added as children.lines
- Raw asciidoctor content
-
getConfig
-
log
-
setConfig
-
updateConfig
-
unwrap
-