Package icyllis.modernui.markdown
Class Markdown
java.lang.Object
icyllis.modernui.markdown.Markdown
Entry point of Markdown API, it provides a context for parsing and rendering Markdown.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Markdown.Builder
Parse Markdown text into AST and render it to Modern UI rich text.static Markdown
Create with default theme and core plugin.<P extends MarkdownPlugin>
P@UnmodifiableView List
<MarkdownPlugin> com.vladsch.flexmark.util.ast.Document
Parse markdown into AST.render
(com.vladsch.flexmark.util.ast.Node document) Render the tree of nodes to Modern UI rich text.<P extends MarkdownPlugin>
PrequirePlugin
(Class<P> type) void
setMarkdown
(TextView textView, String markdown) Parse Markdown text into AST, render it to Modern UI rich text, and install it to the givenTextView
.void
setParsedMarkdown
(TextView textView, Spanned markdown)
-
Method Details
-
create
Create with default theme and core plugin.- Parameters:
context
- view context- Returns:
- markdown inflater
-
builder
-
parse
Parse markdown into AST.- Parameters:
input
- Markdown text to parse- Returns:
- root document
-
render
Render the tree of nodes to Modern UI rich text.Please note that returned Spanned has few limitations. For example, images, tables and ordered lists require TextView to be properly displayed. This is why images and tables most likely won\'t work in this case. Ordered lists might have mis-measurements. Whenever possible use
setMarkdown(TextView, String)
orsetParsedMarkdown(TextView, Spanned)
as these methods will additionally call specificMarkdownPlugin
methods to prepare proper display.- Parameters:
document
- the root node- Returns:
- the rendered Spanned
-
convert
Parse Markdown text into AST and render it to Modern UI rich text.- Parameters:
input
- the markdown text- Returns:
- the rendered Spanned
-
setMarkdown
Parse Markdown text into AST, render it to Modern UI rich text, and install it to the givenTextView
.In most cases, you just need this to display Markdown. Note that you should not change TextView typography attributes after calling this.
-
setParsedMarkdown
-
getPlugin
-
requirePlugin
-
getPlugins
-
getConfig
-