Update README.md
Some checks failed
golangci-lint / lint (push) Successful in 20s
test / test non-docker (1.23.x, 0.12.0) (push) Failing after 3s
test / test non-docker (1.23.x, 0.13.0) (push) Failing after 4s
test / test non-docker (1.23.x, 0.13.1) (push) Failing after 3s
test / test non-docker (1.23.x, 0.14.0) (push) Failing after 4s
test / test docker (1.23.x, ) (push) Failing after 17s
test / test docker (1.23.x, ghcr.io/typst/typst:0.14.0) (push) Failing after 17s
test / test docker (1.23.x, ghcr.io/typst/typst:v0.12.0) (push) Failing after 16s
test / test docker (1.23.x, ghcr.io/typst/typst:v0.13.0) (push) Failing after 17s
test / test docker (1.23.x, ghcr.io/typst/typst:v0.13.1) (push) Failing after 16s

This commit is contained in:
David Vogel 2025-11-16 20:35:37 +01:00
parent e3ab54fd3b
commit 1f6b0f39a0

View File

@ -1,6 +1,6 @@
# go-typst [![test](https://github.com/Dadido3/go-typst/actions/workflows/test.yml/badge.svg)](https://github.com/Dadido3/go-typst/actions/workflows/test.yml) # go-typst [![test](https://github.com/Dadido3/go-typst/actions/workflows/test.yml/badge.svg)](https://github.com/Dadido3/go-typst/actions/workflows/test.yml)
`go-typst` is a Go library that leverages the command-line interface of [Typst] to provide functions for the creation of documents and reports in various formats (PDF, SVG, PNG). `go-typst` is a Go library that leverages the command-line interface of [Typst] to provide functions for the creation of documents and reports in various formats (PDF, SVG, PNG, HTML).
Its goal is to provide Go developers with a seamless, "Go-like" interface to Typst's powerful document generation capabilities. Its goal is to provide Go developers with a seamless, "Go-like" interface to Typst's powerful document generation capabilities.
## Stability and Compatibility ## Stability and Compatibility
@ -64,11 +64,11 @@ typstCaller := typst.CLI{
> [!NOTE] > [!NOTE]
> Make sure to follow the Typst license requirements when you pack and distribute the Typst executable with your software. > Make sure to follow the Typst license requirements when you pack and distribute the Typst executable with your software.
### Docker ### Official Docker image
To use the official Typst docker image ensure that you have a working Docker installation. To use the official Typst Docker image ensure that you have a working Docker installation.
This module will automatically pull and run a Docker container with the latest supported Typst image. `go-typst` will automatically pull and run a Docker container with the latest supported Typst image.
The basic usage pattern is similar to the CLI variant: The basic usage pattern is similar to the CLI variant:
```go ```go
@ -132,7 +132,7 @@ err := typstCaller.Compile(input, output, &typst.OptionsCompile{FontPaths: []str
### Simple document ### Simple document
Here we will create a simple PDF document by passing a reader with Typst markup into `typstCaller.Compile` and then let it write the resulting PDF data into a file: Here we will create a simple document by passing a reader with Typst markup into `typstCaller.Compile` and then let it write the resulting SVG data into a file:
```go ```go
func main() { func main() {
@ -216,11 +216,8 @@ Output:
### More examples ### More examples
It's possible to write custom Typst templates that can be called. It's also possible to write Typst templates that can be invoked from `go-typst`.
Th A full setup can be found in the [passing-values example package](examples/passing-values).
A tutorial for the Typst side can be found in the [Typst documentation: Making a Template](https://typst.app/docs/tutorial/making-a-template/).
An example on how to invoke Typst templates can be found in the [passing-values example package](examples/passing-values).
[the instructions in the Typst repository]: https://github.com/typst/typst?tab=readme-ov-file#installation [the instructions in the Typst repository]: https://github.com/typst/typst?tab=readme-ov-file#installation
[Typst]: https://typst.app/ [Typst]: https://typst.app/