From d04f747efb2176668648b4e3b9d21c02a4603494 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Thu, 20 Aug 2020 00:50:44 +0100 Subject: [PATCH] style: ensure tex templates uses tex extension --- main.go | 4 ++-- template/{cv.tex.tmpl => tex/cv.tmpl.tex} | 2 +- template/{cv_setup.tex.tmpl => tex/cv_setup.tmpl.tex} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename template/{cv.tex.tmpl => tex/cv.tmpl.tex} (97%) rename template/{cv_setup.tex.tmpl => tex/cv_setup.tmpl.tex} (100%) diff --git a/main.go b/main.go index cc0dd62..a228c06 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( var ( cvDataPath string = "data/cv.json" - cvTemplateDir string = "template/" + cvTemplateDir string = "template/tex/" cvOutputDir string = "__output/" cvOutputFileName string = "cv.tex" ) @@ -62,7 +62,7 @@ func main() { // Execute template engine and produce the resulting TEX file log.Println("INFO: Attempting template execution...") - t := template.Must(template.New("cv.tex.tmpl").Funcs(fmap).Delims("<<", ">>").ParseGlob(cvTemplateDir + "*.tex.tmpl")) + t := template.Must(template.New("cv.tmpl.tex").Funcs(fmap).Delims("<<", ">>").ParseGlob(cvTemplateDir + "*.tmpl.tex")) if err = t.Execute(output, cv); err != nil { log.Fatalf("ERROR: Unable to execute the CV template. %s", err.Error()) diff --git a/template/cv.tex.tmpl b/template/tex/cv.tmpl.tex similarity index 97% rename from template/cv.tex.tmpl rename to template/tex/cv.tmpl.tex index 35fe3d1..7a4daea 100644 --- a/template/cv.tex.tmpl +++ b/template/tex/cv.tmpl.tex @@ -1,5 +1,5 @@ <<- /* Prepend the setup area */ ->> -<< template "cv_setup.tex.tmpl" .>> +<< template "cv_setup.tmpl.tex" .>> \starttext \starttitleAndContact diff --git a/template/cv_setup.tex.tmpl b/template/tex/cv_setup.tmpl.tex similarity index 100% rename from template/cv_setup.tex.tmpl rename to template/tex/cv_setup.tmpl.tex