Package icyllis.modernui.markdown
Interface MarkdownPlugin
- All Known Implementing Classes:
CorePlugin
public interface MarkdownPlugin
Class represents an extension to
Markdown to configure how parsing and rendering
of markdown is carried on.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterRender(com.vladsch.flexmark.util.ast.Node document, MarkdownVisitor visitor) This method will be called after rendering (but before applying markdown to a TextView, if such action will happen).default voidafterSetText(TextView textView) This method will be called after markdown was applied.default voidbeforeRender(com.vladsch.flexmark.util.ast.Node document) This method will be called before rendering will occur thus making possible topost-processparsed node (make changes for example).default voidbeforeSetText(TextView textView, Spanned markdown) This method will be called before callingTextView#setText.default voidconfigure(MarkdownPlugin.Registry registry) This method will be called before any other duringMarkdowninstance construction.default voidconfigureConfig(MarkdownConfig.Builder builder) default voidconfigureParser(com.vladsch.flexmark.parser.Parser.Builder builder) default voidconfigureTheme(MarkdownTheme.Builder builder) default StringprocessMarkdown(String markdown) Process input markdown and return new string to be used in parsing stage further.
-
Method Details
-
configure
This method will be called before any other duringMarkdowninstance construction.- Parameters:
registry- the plugin registry
-
configureParser
- Parameters:
builder-
-
configureTheme
- Parameters:
builder-
-
configureConfig
- Parameters:
builder-
-
processMarkdown
Process input markdown and return new string to be used in parsing stage further. Can be described aspre-processingof markdown String.- Parameters:
markdown- String to process- Returns:
- processed markdown String
-
beforeRender
This method will be called before rendering will occur thus making possible topost-processparsed node (make changes for example).- Parameters:
document- root document
-
afterRender
default void afterRender(@NonNull com.vladsch.flexmark.util.ast.Node document, @NonNull MarkdownVisitor visitor) This method will be called after rendering (but before applying markdown to a TextView, if such action will happen). It can be used to clean some internal state, or trigger certain action. Please note that modifyingnodewon\'t have any effect as it has been already visited at this stage.- Parameters:
document- root documentvisitor-MarkdownVisitorinstance used to render markdown
-
beforeSetText
This method will be called before callingTextView#setText.It can be useful to prepare a TextView for markdown.
- Parameters:
textView- TextView to whichmarkdownwill be appliedmarkdown- Rendered markdown
-
afterSetText
This method will be called after markdown was applied.It can be useful to trigger certain action on spans/textView.
Unlike
beforeSetText(TextView, Spanned)this method does not receive parsed markdown as at this point spans must be queried by callingTextView#getText#getSpans.- Parameters:
textView- TextView to which markdown was applied
-