mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
feat: add defaultColWidth template function
This function can be used in templates to change the default column width to accommodate wider terminals.
This commit is contained in:
@@ -263,6 +263,10 @@ func RunTemplate(templateName string, data interface{}, out io.Writer) error {
|
||||
headers := []string{}
|
||||
cells := [][]string{}
|
||||
tmpl, err := TemplateProcessor().Funcs(map[string]interface{}{
|
||||
"defaultColWidth": func(cw int) string {
|
||||
table.SetColWidth(cw)
|
||||
return ""
|
||||
},
|
||||
"headers": func(titles ...string) string {
|
||||
headers = append(headers, titles...)
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user