This crate is a work in progress to create libraries to render markdown for the main rust web frameworks:
| Framework | Package | Crate | Source |
|---|---|---|---|
| Dioxus | dioxus-markdown |
https://crates.io/crates/dioxus-markdown | here |
| Leptos | leptos-markdown |
coming soon | here |
| Yew | yew-markdown |
https://crates.io/crates/yew-markdown | here |
Take a look at the different examples !
The following examples are build using Yew, but they are implemented for all frameworks.
the example is included in ./examples/showcase
see here
Of course, an example of a basic markdown editor is implemented to show what is currently supported
see here
see here
see here
Custom components allow you to embed interactive or custom-styled elements in your markdown.
To be recognized as a custom component, tag names must follow these rules:
-
Uppercase start - Tags starting with an uppercase letter (A-Z) are always treated as custom components
- Examples:
<MyComponent>,<Counter>,<DataTable>
- Examples:
-
Lowercase with dash - Tags starting with lowercase (a-z) must contain at least one dash (-)
- Examples:
<my-component>,<data-table>,<custom-counter>
- Examples:
These rules ensure standard HTML tags like <div>, <span>, and <p> are not confused with custom components.
Valid custom components:
<MyComponent><my-component><Counter initial="5"/>
PRs are very much appreciated.
- Mark
ElementAttributesasnon_exhaustiveso future changes can add more attributes as a non breaking change. - Include crate README.
- Require use of methods to access contents of
MdComponentProps's attributes. This also removes the ability fore consumers to directly construct aMdComponentPropsinstance. - Expose the location of
MdComponentPropsattributes in the source as a range. HtmlErrorhas been removed from the package API.- Replace
katexwithkatex-rsfor math rendering, improving performance and platform support. - Fix empty crash on empty codeblocks.
- Add opt out for preserving html.
- Documentation improvements.
