Skip to content

Commit

Permalink
WIP hexa interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo-Hafsaoui committed Nov 1, 2024
1 parent 02330a6 commit 5e16a72
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
19 changes: 10 additions & 9 deletions internal/adapters/output/latex_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ import (
"os"
)

//Read the template file in the assets directory
func readCVTemplate(path string)(string, error){
file, err := os.ReadFile(path+"/assets/latex/template/template.tex")
if err != nil {
return "", err
}
return string(file), nil
}

//Write the template file in the assets directory
func makeNewCV(path string, template string, name string)error{
func makeNewTemplate(path string, template string, name string)error{

Check failure on line 13 in internal/adapters/output/latex_writer.go

View workflow job for this annotation

GitHub Actions / Run Linter

func `makeNewTemplate` is unused (unused)
err := os.WriteFile(path+"/assets/latex/output/"+name,
[]byte(template), 0644)
return err
}

//Read the template file in the assets directory from the root dir
func readCVTemplate(root string)(string, error){

Check failure on line 20 in internal/adapters/output/latex_writer.go

View workflow job for this annotation

GitHub Actions / Run Linter

func `readCVTemplate` is unused (unused)
file, err := os.ReadFile(root+"/assets/latex/template/template.tex")
if err != nil {
return "", err
}
return string(file), nil
}

//In the core we will read the template
//iterate by section
//Apply to template
Expand Down
19 changes: 13 additions & 6 deletions internal/core/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ import (
"fmt"
"strings"
)
//TODO replace with interface
//
//type geometry interface {
// area() float64
// perim() float64
//}

type Source interface {
GetCVsFrom(root string) ([]CV, error)
}

type TemplateReader interface {
readCVTemplate(path string)(string, error)
}

type TemplateProcessor interface {
makeNewTemplate(path string, template string, name string)error
ApplySectionToTemplate(template string, headers []string,item []string, section string) (string,error)
}

//CV with Language and Sections
type CV struct {
Expand Down

0 comments on commit 5e16a72

Please sign in to comment.