Skip to content

Commit

Permalink
feat: conveniently access an Output's template func map
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Sep 22, 2022
1 parent 6dd5b52 commit 3d57dcd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templatehelper.go
Expand Up @@ -4,6 +4,11 @@ import (
"text/template"
)

// TemplateFuncs returns template helpers for the given output.
func (o Output) TemplateFuncs() template.FuncMap {
return TemplateFuncs(o.Profile)
}

// TemplateFuncs contains a few useful template helpers.
func TemplateFuncs(p Profile) template.FuncMap {
if p == Ascii {
Expand Down

0 comments on commit 3d57dcd

Please sign in to comment.