pub trait MarkdownPlugin:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &str;
fn parse(
&self,
node: &Node,
cx: &MarkdownParseContext<'_>,
) -> Option<MarkdownNode>;
fn render(
&self,
node: &MarkdownNode,
window: &mut Window,
cx: &mut App,
) -> impl IntoElement;
// Provided method
fn is_block(&self) -> bool { ... }
}Expand description
A reusable Markdown extension that parses and renders one custom node.
Required Methods§
Sourcefn parse(
&self,
node: &Node,
cx: &MarkdownParseContext<'_>,
) -> Option<MarkdownNode>
fn parse( &self, node: &Node, cx: &MarkdownParseContext<'_>, ) -> Option<MarkdownNode>
Convert an mdast node into a custom Markdown node.
Sourcefn render(
&self,
node: &MarkdownNode,
window: &mut Window,
cx: &mut App,
) -> impl IntoElement
fn render( &self, node: &MarkdownNode, window: &mut Window, cx: &mut App, ) -> impl IntoElement
Render a custom Markdown node produced by this plugin.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".