Markdown to HTML conversion for the Donna programming language.
markdown is a small Donna wrapper around the MD4C C Markdown parser.
It exposes one focused function: convert a Markdown document string into an HTML fragment.
Add to your donna.toml as a dependency:
[dependencies]
markdown = { git = "https://github.com/NikolasSkyl/markdown", version = ">=0.1.0 and <1.0.0" }Then import the module:
import markdown
import markdown
pub fn render_post() -> String:
markdown.to_html("# Hello Donna\n\nThis is **Markdown**.")
Use it in an app:
import markdown
pub fn main() -> Nil:
echo markdown.to_html("Hello *Donna*")
Run tests:
donna testFor API Reference visit the generated docs here
to_html returns an HTML fragment:
markdown.to_html("# Hello")
<h1>Hello</h1>This package vendors MD4C, which is distributed under the MIT licence.
MIT