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{}
|
headers := []string{}
|
||||||
cells := [][]string{}
|
cells := [][]string{}
|
||||||
tmpl, err := TemplateProcessor().Funcs(map[string]interface{}{
|
tmpl, err := TemplateProcessor().Funcs(map[string]interface{}{
|
||||||
|
"defaultColWidth": func(cw int) string {
|
||||||
|
table.SetColWidth(cw)
|
||||||
|
return ""
|
||||||
|
},
|
||||||
"headers": func(titles ...string) string {
|
"headers": func(titles ...string) string {
|
||||||
headers = append(headers, titles...)
|
headers = append(headers, titles...)
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
Reference in New Issue
Block a user