Use new typst rendering in /test endpoint
This commit is contained in:
parent
8526566f39
commit
428b825e43
15 changed files with 128 additions and 14 deletions
19
showbits-thermal-printer/src/documents/text/mod.rs
Normal file
19
showbits-thermal-printer/src/documents/text/mod.rs
Normal 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"))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue