2022-06-15 23:36:47 +02:00
|
|
|
// Copyright 2022 wanderer <a_mirre at utb dot cz>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
//go:build ignore
|
|
|
|
// +build ignore
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2022-07-17 13:28:45 +02:00
|
|
|
_ "embed"
|
2022-06-15 23:36:47 +02:00
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
"text/template"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2022-07-17 13:28:45 +02:00
|
|
|
var (
|
|
|
|
//go:embed report_base.tex
|
|
|
|
reportBase []byte
|
2022-06-15 23:36:47 +02:00
|
|
|
|
2022-07-17 13:28:45 +02:00
|
|
|
//go:embed report.tmpl
|
|
|
|
tmplReportFile []byte
|
|
|
|
)
|
2022-06-15 23:36:47 +02:00
|
|
|
|
2022-07-17 13:28:45 +02:00
|
|
|
func main() {
|
|
|
|
fName := "../out/tex/report.tex"
|
|
|
|
f, err := os.Create(fName)
|
2022-06-15 23:36:47 +02:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
defer f.Close()
|
|
|
|
|
2022-07-17 13:28:45 +02:00
|
|
|
tmplReport := template.New("report")
|
|
|
|
tmplReport = template.Must(tmplReport.Parse(string(tmplReportFile)))
|
2022-06-15 23:36:47 +02:00
|
|
|
|
2022-07-17 13:28:45 +02:00
|
|
|
err = tmplReport.Execute(f, struct {
|
|
|
|
ReportBase string
|
|
|
|
Timestamp time.Time
|
2022-06-15 23:36:47 +02:00
|
|
|
}{
|
2022-07-17 13:28:45 +02:00
|
|
|
ReportBase: string(reportBase),
|
|
|
|
Timestamp: time.Now(),
|
2022-06-15 23:36:47 +02:00
|
|
|
})
|
2022-07-17 13:28:45 +02:00
|
|
|
|
2022-06-15 23:36:47 +02:00
|
|
|
if err != nil {
|
|
|
|
log.Println(err)
|
|
|
|
}
|
|
|
|
}
|