public abstract class InlineMacroProcessor extends MacroProcessor<ContentNode>
Modifier and Type | Field and 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.
|
name
config, CONTENT_MODEL, CONTENT_MODEL_ATTRIBUTES, CONTENT_MODEL_COMPOUND, CONTENT_MODEL_EMPTY, CONTENT_MODEL_RAW, CONTENT_MODEL_SIMPLE, CONTENT_MODEL_SKIP, CONTENT_MODEL_VERBATIM
Constructor and Description |
---|
InlineMacroProcessor() |
InlineMacroProcessor(java.lang.String macroName) |
InlineMacroProcessor(java.lang.String macroName,
java.util.Map<java.lang.String,java.lang.Object> config) |
getName, options, process, setName
createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createDocument, createListItem, createListItem, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createSection, createSection, createSection, createSection, createTable, createTable, createTableCell, createTableCell, createTableCell, createTableCell, createTableColumn, createTableColumn, createTableRow, getConfig, parseContent, setConfig, setConfigFinalized, updateConfig
public static final java.lang.String REGEXP
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.