igumnoff / shiva

Shiva library: Implementation in Rust of a parser and generator for documents of any type
https://docs.rs/shiva
GNU General Public License v3.0
161 stars 11 forks source link

Typst generator #19

Closed evgenyigumnov closed 3 months ago

evgenyigumnov commented 4 months ago

https://crates.io/crates/typst

  1. crate module "typst"
  2. Implement "Typst generator" (generate function)
    pub trait TransformerTrait {
    fn parse(document: &Bytes) -> anyhow::Result<Document>;
    fn generate(document: &Document) -> anyhow::Result<Bytes>;
    }
  3. Units test requered for this new feature (looks at tests in json module)

PS

you should do refactoring of pdf.rs generation function and move part of logic inside to mod typst.rs generation function