hunt-markdown 1.0.4

A markdown parsing and rendering library for D programming language.


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

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);
Dependencies:
hunt
Versions:
1.0.4 2019-Jun-06
1.0.3 2019-Jun-05
1.0.2 2019-Jun-05
1.0.1 2019-May-01
1.0.0 2019-Feb-19
Show all 6 versions
Download Stats:
  • 0 downloads today

  • 2 downloads this week

  • 14 downloads this month

  • 21 downloads total

Score:
0.9
Short URL:
hunt-markdown.dub.pm