Expand description
§mogwai-md
A markdown rendering widget for mogwai.
mogwai-md parses markdown using pulldown-cmark
and lowers the event stream directly into a mogwai view tree. Because it
builds real DOM elements (not an HTML string), the same widget works in WASM
(mogwai::web::Web) and server-side rendering (mogwai::ssr::Ssr).
§Quickstart
use mogwai::prelude::*;
use mogwai::web::Web;
use mogwai_md::Markdown;
let md = Markdown::<Web>::new("# Hello, world\n\nThis is **mogwai-md**.");
mogwai::web::body().append_child(&md);See the examples/demo crate for a trunk-servable example.
Re-exports§
pub use pulldown_cmark;
Structs§
- Markdown
- A read-only markdown rendering widget.
Functions§
- append_
children - Parse
srcwithoptsand append the resulting view tree toparent. - children
- Parse
srcwithoptsand return the top-level block elements. - default_
options - The parser options used by
crate::Markdown::new: CommonMark + GFM tables, strikethrough, and task lists.