typst_batch/codegen/mod.rs
1//! Typst code generation and type conversion.
2//!
3//! Provides bidirectional conversion between Rust/JSON and Typst types.
4//!
5//! # Modules
6//!
7//! - [`serialize`] - Typst → JSON conversion
8//! - [`deserialize`] - JSON → Typst conversion
9//! - [`lookup`] - Function lookup utilities
10//! - [`source`] - Rust → Typst source code generation
11//! - [`builder`] - Dict/Array construction helpers
12//! - [`inputs`] - sys.inputs builder from JSON
13//! - [`error`] - Error types
14
15mod builder;
16mod deserialize;
17mod error;
18mod inputs;
19mod literal;
20mod lookup;
21mod roundtrip;
22mod serialize;
23mod source;
24
25
26
27// Serialization (Typst → JSON)
28pub use serialize::{content_to_json, json_to_simple_text, value_to_json};
29
30// Deserialization (JSON → Typst)
31pub use deserialize::{json_to_content, json_to_value};
32
33// Literal parsing (string → Typst value)
34pub use literal::{parse_typst_literal, parse_angle, parse_color, parse_length, parse_ratio};
35
36// Source generation
37pub use source::ToTypst;
38
39// Builders
40pub use builder::{array, array_raw, dict, dict_raw, dict_sparse, format_array, DictBuilder};
41
42// Inputs
43pub use inputs::{json_to_simple_value, Inputs};
44
45// Errors
46pub use error::ConvertError;