| Crates.io | typst-2-rsx |
| lib.rs | typst-2-rsx |
| version | 0.2.0 |
| created_at | 2025-02-06 11:51:36.786672+00 |
| updated_at | 2025-02-09 14:30:06.658487+00 |
| description | Convert Typst documents into RSX SVG elements for use in Rust UI development. |
| homepage | |
| repository | https://github.com/Etase/typst-2-rsx |
| max_upload_size | |
| id | 1545436 |
| size | 1,224,409 |
Convert Typst documents (.typ) into RSX elements as SVG components.
typst-2-rsx is a Rust library that automates the conversion of Typst documents into RSX elements. It first uses the typst CLI to compile .typ files into .svg, and then parses the .svg file into RSX elements, making it easy to integrate Typst-generated content into Rust-based UI frameworks like Dioxus.
cargo add typst-2-rsx
Or manually add to Cargo.toml:
[dependencies]
typst-2-rsx = "0.2.0"
Then run the cargo build to compile.
use typst_2_rsx::typst_to_rsx;
let rsx_svg = typst_to_rsx("example.typ").expect("Conversion failed");
println!("{}", rsx_svg);
.typ to .svg using the typst CLI..svg file.This project is licensed under MIT OR Apache-2.0.