Use new typst rendering in /test endpoint

This commit is contained in:
Joscha 2025-02-28 23:10:31 +01:00
parent 8526566f39
commit 428b825e43
15 changed files with 128 additions and 14 deletions

View file

@ -0,0 +1,19 @@
use serde::{Deserialize, Serialize};
use showbits_typst::Typst;
#[derive(Serialize, Deserialize)]
pub struct Text {
pub text: String,
#[serde(default)]
pub force_wrap: bool,
#[serde(default)]
pub feed: bool,
}
impl From<Text> for Typst {
fn from(value: Text) -> Self {
super::typst_with_lib()
.with_json("/data.json", &value)
.with_main_file(include_str!("main.typ"))
}
}