Crates.io | askama-markdown-cmark |
lib.rs | askama-markdown-cmark |
version | 0.1.0 |
source | src |
created_at | 2024-07-10 14:57:47.075696 |
updated_at | 2024-07-10 14:57:47.075696 |
description | Askama filter for markdown, using pulldown-cmark. |
homepage | |
repository | https://github.com/blakehawkins/askama-markdown-cmark |
max_upload_size | |
id | 1298370 |
size | 9,684 |
An askama
filter to render markdown
to html.
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(())
}