mirror of
https://github.com/Dadido3/go-typst.git
synced 2025-11-20 11:49:36 +00:00
|
Some checks failed
test / test non-docker (1.23.x, 0.12.0) (push) Failing after 4s
test / test non-docker (1.23.x, 0.13.0) (push) Failing after 3s
test / test non-docker (1.23.x, 0.13.1) (push) Failing after 4s
test / test non-docker (1.23.x, 0.14.0) (push) Failing after 3s
test / test docker (1.23.x, ) (push) Failing after 23s
test / test docker (1.23.x, ghcr.io/typst/typst:0.14.0) (push) Failing after 15s
test / test docker (1.23.x, ghcr.io/typst/typst:v0.12.0) (push) Failing after 20s
test / test docker (1.23.x, ghcr.io/typst/typst:v0.13.0) (push) Failing after 19s
test / test docker (1.23.x, ghcr.io/typst/typst:v0.13.1) (push) Failing after 21s
|
||
|---|---|---|
| .. | ||
| main_test.go | ||
| main.go | ||
| output.pdf | ||
| README.md | ||
| template-preview.typ | ||
| template.typ | ||
Passing values example
This example demonstrates how to pass values to Typst, which can be useful in rendering custom documents such as reports, invoices, and more.
How it works
This example follows the template pattern described in the Typst documentation. Here is a short overview of the files:
- template.typ defines a Typst template function that constructs a document based on parameters.
- main.go shows how to convert/encode Go values into Typst markup, and how to call/render the template with these converted values.
- template-preview.typ also invokes the template while providing mock data. This is useful when you want to preview, update or debug the template.