Package org.asciidoctor.extension
Class InlineMacroProcessor
- java.lang.Object
-
- org.asciidoctor.extension.BaseProcessor
-
- org.asciidoctor.extension.MacroProcessor<PhraseNode>
-
- org.asciidoctor.extension.InlineMacroProcessor
-
- All Implemented Interfaces:
Processor
public abstract class InlineMacroProcessor extends MacroProcessor<PhraseNode>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REGEXP
This value is used as the config option key when defining a regular expression that should be used to match an inline macro invocation.-
Fields inherited from class org.asciidoctor.extension.MacroProcessor
name
-
-
Constructor Summary
Constructors Constructor Description InlineMacroProcessor()
InlineMacroProcessor(java.lang.String macroName)
InlineMacroProcessor(java.lang.String macroName, java.util.Map<java.lang.String,java.lang.Object> config)
-
Method Summary
-
Methods inherited from class org.asciidoctor.extension.MacroProcessor
getName, options, process, setName
-
Methods inherited from class org.asciidoctor.extension.BaseProcessor
createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createDocument, createList, createList, createList, createListItem, createListItem, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createSection, createSection, createSection, createSection, createSection, createTable, createTable, createTableCell, createTableCell, createTableCell, createTableCell, createTableColumn, createTableColumn, createTableRow, getConfig, log, newCursor, newCursor, newCursor, newReader, newReader, newReader, newReader, parseContent, setConfig, unwrap, updateConfig
-
-
-
-
Field Detail
-
REGEXP
public static final java.lang.String REGEXP
This value is used as the config option key when defining a regular expression that should be used to match an inline macro invocation. Its value must be a String containing a regular expression :Example to make a InlineMacroProcessor work on inline macros of the form
man:[A-Za-z0-9]+\\[.*?\\]
:Map<String, Object> config = new HashMap<>(); config.put(REGEXP, "man:([A-Za-z0-9]+)\\[(.*?)\\]"); InlineMacroProcessor inlineMacroProcessor = new InlineMacroProcessor("man", config); asciidoctor.javaExtensionRegistry().inlineMacro(inlineMacroProcessor); Note the parens
(
and)
in the regular expression in the example to capture the target and attributes of the macro invocation.- See Also:
- Constant Field Values
-
-