added typst as doc creator and put it into compose container

This commit is contained in:
2025-12-02 16:50:37 +01:00
parent 6ab48eb534
commit 02b5d88d34
8 changed files with 115 additions and 28 deletions

View File

@@ -72,7 +72,7 @@ func renderPDF(days []typstDay, metadata typstMetadata) (bytes.Buffer, error) {
// Import the template and invoke the template function with the custom data.
// Show is used to replace the current document with whatever content the template function in `template.typ` returns.
markup.WriteString(`
#import "template.typ": abrechnung
#import "templates/abrechnung.typ": abrechnung
#show: doc => abrechnung(meta, days)
`)
@@ -84,7 +84,10 @@ func renderPDF(days []typstDay, metadata typstMetadata) (bytes.Buffer, error) {
// defer f.Close()
//
typstCLI := typst.CLI{}
// typstCLI := typst.CLI{}
typstCLI := typst.DockerExec{
ContainerName: helper.GetEnv("TYPST_CONTAINER", "arbeitszeitmessung-doc-creator"),
}
if err := typstCLI.Compile(&markup, &output, nil); err != nil {
return output, err
}