Closed evgenyigumnov closed 4 months ago
pub trait TransformerTrait { fn parse(document: &Bytes, images: &HashMap<String, Bytes>) -> anyhow::Result<Document>; fn generate(document: &Document) -> anyhow::Result<(Bytes, HashMap<String, Bytes>)>; }
Currently used Bytes for pictures. We need to switch to Closure
pub trait TransformerTrait { fn parse(document: &Bytes) -> anyhow::Result<Document>; fn generate(document: &Document) -> anyhow::Result<Bytes>; }
pub trait TransformerWithImageLoaderSaverTrait { fn parse_with_loader<F>(document: &Bytes, image_loader: F) -> anyhow::Result<Document> where F: Fn(&str) -> anyhow::Result<Bytes>; fn generate_with_saver<F>(document: &Document, image_saver: F) -> anyhow::Result<Bytes> where F: Fn(&Bytes, &str) -> anyhow::Result<()>; }
Currently used Bytes for pictures. We need to switch to Closure
Required: shiva::core::TransformerTrait
Optional shiva::core::TransformerWithImageLoaderSaverTrait (If images store outside of document for example: HTML, Markdown)