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 | ||
Simple example
This example shows how to render Typst documents directly from strings in Go.
The pros and cons
The main advantage of this method is that it's really easy to set up.
In the most simple case you build your Typst markup by concatenating strings, or by using fmt.Sprintf.
The downside is that the final Typst markup is only generated on demand. This means that you can't easily use the existing Typst tooling to write, update or debug your Typst markup. Especially as your your documents get more complex, you should switch to other methods.