1 unstable release
0.1.0 | Jul 10, 2024 |
---|
#1165 in Text processing
4KB
An askama
filter to render markdown
to html.
Example
use askama::Template;
use askama_markdown_cmark::filters;
#[derive(Template)]
#[template(source = "{{ content|markdown_cmark|safe }}", ext="html")]
struct Example<'a> {
content: &'a str,
}
fn main() -> Result<()> {
println!("{}", Example { content: "## Hello world\n\nTesting ~~x~~ **y** _z_\n" }.render().unwrap());
Ok(())
}
Dependencies
~2.3–3MB
~62K SLoC