4 ms·
The only downside of typst is that there is no libtypst, which would make it easy to embed.
by merb 2y ago
The only downside of typst is that there is no libtypst, which would make it easy to embed.
- rubyfan 2y agoThere's a few examples of language binding that would give you a starting point to embed typst in anything https://github.com/messense/typst-py https://github.com/messense/typst-py https://github.com/rousbound/typst-lua https://github.com/rousbound/typst-lua https://github.com/actsasflinn/typst-rb https://github.com/actsasflinn/typst-rb
- ioasuncvinvaer 2y agohttps://crates.io/crates/typst https://crates.io/crates/typst
- merb 2y agoThat’s a rust library or rather typst code also gets published to crates.io. But it’s not something that can be turned into a libtypst.so/dylib/dll.
- colonial 2y agoYou can turn a Rust library into a dynamic library w/ a C ABI - exposing the whole API would be tedious, even with tools like bindgen, but if you just want to provide a "render this char* to PDF" function (or whatever) then it's pretty easy [1]. I know of a few Rust crates that offer something like this - Minijinja, off the top of my head. [1]: https://doc.rust-lang.org/nomicon/ffi.html#calling-rust-code-from-c https://doc.rust-lang.org/nomicon/ffi.html#calling-rust-code...
- merb 2y agoYeah but than I would need to maintain the wrapper lib.