Commit Graph

6 Commits

Author SHA1 Message Date
c3876b340b Rename Variable* to Value*
- Rename MarshalVariable to MarshalValue
- Rename NewVariableEncoder to NewValueEncoder
- Rename VariableEncoder to ValueEncoder
- Rename VariableMarshaler to ValueMarshaler
- Rename MarshalTypstVariable to MarshalTypstValue

There are now wrappers which ensure compatibility with code that still uses some of the old functions/types.

- Improve image_test.go by adding an assertion
- Rename all occurrences of Variable to Value
- Remove "TODO: Handle images..." as that's already working with the image wrapper
- Update README.md
2025-02-27 18:07:46 +01:00
2a1d2990e7 Add simple example 2025-02-27 16:08:02 +01:00
9268a6691e Rework passing-values example
This changes the example to use the template pattern; we now have a single Typst file containing a template function.
Instead of loading and rendering the template, we will now generate temporary Typst markup that will import the template function and call it with custom data.

This also means that it's pretty easy to test, preview and debug the template.typ outside of go-typst.
All that is needed is another Typst file which will call the template with mock data.

Also, we now use Compile instead of CompileWithVariables and inject encoded Go values into our temporary markup.
2025-02-27 16:07:34 +01:00
112898d1d7 Rename example from passing-objects to passing-values 2025-02-27 10:35:01 +01:00
1458dc5db7 Rename CLI.Render to CLI.Compile 2024-12-19 17:18:11 +01:00
f42f1cb385 Add example for passing go values 2024-12-18 23:20:12 +01:00