See: Description
Package | Description |
---|---|
com.vladsch.flexmark |
Root package of flexmark-java
com.vladsch.flexmark.parser for parsing input text to AST nodes
com.vladsch.flexmark.ast for Core AST nodes
com.vladsch.flexmark.html for HTML rendering
|
com.vladsch.flexmark.ast |
AST node types (see
Node ) and visitors (see NodeAdaptedVisitor ) |
com.vladsch.flexmark.ast.util | |
com.vladsch.flexmark.html |
HTML rendering (see
HtmlRenderer ) |
com.vladsch.flexmark.html.renderer | |
com.vladsch.flexmark.internal | |
com.vladsch.flexmark.internal.inline | |
com.vladsch.flexmark.parser |
Parse input text to AST nodes see
Parser |
com.vladsch.flexmark.parser.block |
Types for extending block parsing
|
com.vladsch.flexmark.parser.delimiter |
Java implementation of CommonMark for parsing markdown and rendering to HTML (core library)
Example:
import com.vladsch.flexmark.ast.Node;
import com.vladsch.flexmark.html.HtmlRenderer;
import com.vladsch.flexmark.parser.Parser;
import com.vladsch.flexmark.parser.ParserEmulationProfile;
import com.vladsch.flexmark.util.options.MutableDataSet;
class Main {
static void main(String[] args) {
MutableDataSet options = new MutableDataSet();
//Optionally Select Emulation Profile:
// COMMONMARK (default), FIXED_INDENT, KRAMDOWN,
// MARKDOWN, GITHUB_DOC, MULTI_MARKDOWN, PEGDOWN
// options.setFrom(ParserEmulationProfile.KRAMDOWN);
// Optionally, tweak behavior
options.set(HtmlRenderer.ESCAPE_HTML, true);
Parser parser = Parser.builder(options).build();
HtmlRenderer renderer = HtmlRenderer.builder(options).build();
Node document = parser.parse("This is *Sparta*");
renderer.render(document); // "<p>This is <em>Sparta</em></p>\n"
}
}
See the following packages for details:
com.vladsch.flexmark.parser
for parsing input text to AST nodescom.vladsch.flexmark.ast
for AST node types and visitorscom.vladsch.flexmark.html
for HTML renderingCopyright © 2018. All rights reserved.