mirror of https://github.com/rwxrob/bonzai
Replace Dynamic with template.FuncMap
Must better and more resilient. Also allows the creation of template domain languages by individual Cmd authors. First `indent` builtin created.pull/85/head v0.5.0
parent
966dc7ac29
commit
87300a5828
@ -0,0 +1,19 @@
|
||||
package Z
|
||||
|
||||
import (
|
||||
"text/template"
|
||||
|
||||
"github.com/rwxrob/to"
|
||||
)
|
||||
|
||||
// This file contains the BonzaiMark builtins that Cmd authors can use
|
||||
// in their Description and other places where templated BonzaiMark is
|
||||
// allowed.
|
||||
|
||||
var markFuncMap = template.FuncMap{
|
||||
"indent": indent,
|
||||
}
|
||||
|
||||
func indent(n int, in string) string {
|
||||
return to.Indented(in, IndentBy+n)
|
||||
}
|
Loading…
Reference in New Issue