macro_rules! pipeline {
($doc:expr => $($transform:expr),* $(,)?) => { ... };
}Expand description
Macro for creating transformation pipelines with a more functional syntax
ยงExample
use markdown_ppp::ast::*;
use markdown_ppp::ast_transform::*;
use markdown_ppp::pipeline;
let original_doc = Document {
blocks: vec![Block::Paragraph(vec![Inline::Text(" hello ".to_string())])],
};
let result = pipeline! {
original_doc =>
|d: Document| d.transform_text(|s| s.trim().to_string()),
|d: Document| d.normalize_whitespace(),
};