A port of yew-markdown using leptos !
Usage
You can use this component to render both static and dynamic markdown.
Static markdown
use leptos::*;
{
...
view!{cx,
<Markdown src="# Markdown Power !"/>
}
}
Dynamic markdown
{
...
let (content, set_content) = create_signal(cx, "# Markdown Power !".to_string());
view!{cx,
<Markdown src=content/>
}
}
Examples
To build them, just follow the leptos installation instructions and run trunk serve
to try them.
Showcase
./examples/showcase
You can see the result here
To be fair, this is not the vanilla component, there is a bit of styling added.
Editor
./examples/editor
There is a demo of an interactive editor here
Onclick
./examples/onclick/
Illustrates a cool feature of this crate: onclick
events for any rendered content
Try it here
Comparison
This project was great to compare the advantages and drawbacks of the two major rust web frameworks !
see my feedback for a comparison