rs_web/markdown/transforms/trait.rs
1use pulldown_cmark::Event;
2
3use crate::markdown::TransformContext;
4
5/// Trait for AST transformations
6#[allow(unused)]
7pub trait AstTransform: Send + Sync {
8 /// Human-readable name for debugging/logging
9 fn name(&self) -> &'static str;
10
11 /// Priority for ordering (lower runs first)
12 fn priority(&self) -> i32 {
13 100
14 }
15
16 /// Transform the events, returning modified events
17 fn transform<'a>(&self, events: Vec<Event<'a>>, ctx: &TransformContext<'_>) -> Vec<Event<'a>>;
18}