hunt-markdown ~master
A markdown parsing and rendering library for D programming language.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
hunt-markdown
A markdown parsing and rendering library for D programming language. The project use commonmark spec, ported from commonmark-java.
Parse and render
import hunt.markdown.node.Node;
import hunt.markdown.parser.Parser;
import hunt.markdown.renderer.html.HtmlRenderer;
Parser parser = Parser.builder().build();
Node document = parser.parse("This is *New*");
HtmlRenderer renderer = HtmlRenderer.builder().build();
renderer.render(document); // "<p>This is <em>New</em></p>\n"
How to use Tables extension?
string markdown = `
## Test for tables
| head 1 | head 2 | head 3 |
|--------|--------|--------|
| row 1.1 | row 1.2 | row 1.3 |
| row 2.1 | row 2.2 | row 2.3 |
`;
auto extensions = Collections.singleton(TableExtension.create());
Parser parser = Parser.builder().extensions(extensions).build();
Node document = parser.parse(markdown);
HtmlRenderer renderer = HtmlRenderer.builder().extensions(extensions).build();
renderer.render(document);
- Registered by zoujiaqing
- ~master released 2 years ago
- huntlabs/hunt-markdown
- www.huntLabs.net
- Apache-2.0
- Copyright © 2019-2020, HuntLabs
- Dependencies:
- hunt-extra
- Versions:
-
1.2.0 2022-Apr-15 1.1.0 2020-Jun-12 1.0.5 2019-Oct-28 1.0.4 2019-Jun-06 1.0.3 2019-Jun-05 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
217 downloads total
-
- Score:
- 1.2
- Short URL:
- hunt-markdown.dub.pm