Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The only downside of typst is that there is no libtypst, which would make it easy to embed.



That’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.


You 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...


Yeah but than I would need to maintain the wrapper lib.


There'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/rousbound/typst-lua

https://github.com/actsasflinn/typst-rb




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: