Package icyllis.modernui.markdown
Class MarkdownConfig.Builder
java.lang.Object
icyllis.modernui.markdown.MarkdownConfig.Builder
- Enclosing class:
MarkdownConfig
-
Method Summary
Modifier and TypeMethodDescription<N extends com.vladsch.flexmark.util.ast.Node>
MarkdownConfig.BuilderaddVisitor
(Class<? extends N> clazz, NodeVisitor<? super N> visitor) Override any existing visitor for the given type.<N extends com.vladsch.flexmark.util.ast.Node>
MarkdownConfig.BuilderappendSpanFactory
(Class<? extends N> clazz, SpanFactory<? super N> factory) Append a factory to existing one (or make the first one for specified node).build
(MarkdownTheme theme) <N extends com.vladsch.flexmark.util.ast.Node>
SpanFactory<N> getSpanFactory
(Class<N> node) Can be useful when enhancing an already defined SpanFactory with another one.<N extends com.vladsch.flexmark.util.ast.Node>
MarkdownConfig.BuilderprependSpanFactory
(Class<? extends N> clazz, SpanFactory<? super N> factory) Prepend a factory to existing one (or make the first one for specified node).setBlockHandler
(BlockHandler blockHandler) <N extends com.vladsch.flexmark.util.ast.Node>
MarkdownConfig.BuildersetSpanFactory
(Class<? extends N> clazz, SpanFactory<? super N> factory)
-
Method Details
-
addVisitor
@NonNull public <N extends com.vladsch.flexmark.util.ast.Node> MarkdownConfig.Builder addVisitor(@NonNull Class<? extends N> clazz, @Nullable NodeVisitor<? super N> visitor) Override any existing visitor for the given type.- Parameters:
clazz
- node type (exact class)visitor
-NodeVisitor
to be used, null to remove existing- Returns:
- this
-
setSpanFactory
@NonNull public <N extends com.vladsch.flexmark.util.ast.Node> MarkdownConfig.Builder setSpanFactory(@NonNull Class<? extends N> clazz, @Nullable SpanFactory<? super N> factory) -
appendSpanFactory
@NonNull public <N extends com.vladsch.flexmark.util.ast.Node> MarkdownConfig.Builder appendSpanFactory(@NonNull Class<? extends N> clazz, @NonNull SpanFactory<? super N> factory) Append a factory to existing one (or make the first one for specified node). Specified factory will be called after original (if present) factory. Can be used to change behavior or original span factory.- Parameters:
clazz
- node typefactory
- span factory- Returns:
- this
-
prependSpanFactory
@NonNull public <N extends com.vladsch.flexmark.util.ast.Node> MarkdownConfig.Builder prependSpanFactory(@NonNull Class<? extends N> clazz, @NonNull SpanFactory<? super N> factory) Prepend a factory to existing one (or make the first one for specified node). Specified factory will be calledbefore original (if present) factory.- Parameters:
clazz
- node typefactory
- span factory- Returns:
- this
-
getSpanFactory
@Nullable public <N extends com.vladsch.flexmark.util.ast.Node> SpanFactory<N> getSpanFactory(@NonNull Class<N> node) Can be useful when enhancing an already defined SpanFactory with another one. -
setBlockHandler
- Parameters:
blockHandler
- to handle block start/end- Returns:
- this
-
build
-