= SprigX Brent Saner Last rendered {localdatetime} :doctype: book :docinfo: shared :data-uri: :imagesdir: images :sectlinks: :sectnums: :sectnumlevels: 7 :toc: preamble :toc2: left :idprefix: :toclevels: 7 :source-highlighter: rouge :docinfo: shared [id="wat"] == What is SprigX? SprigX are extensions to https://masterminds.github.io/sprig/[the `sprig` library^] (https://pkg.go.dev/github.com/Masterminds/sprig/v3[Go docs^]). They provide functions that offer more enriched use cases and domain-specific data. [TIP] ==== If you are reading this README on the Go Module Directory documentation (https://pkg.go.dev/r00t2.io/goutils/tplx/sprigx) or the directory landing page (https://git.r00t2.io/r00t2/go_goutils/src/branch/master/tplx/sprigx), it may not render correctly. Be sure to view it at properly via https://git.r00t2.io/r00t2/go_goutils/src/branch/master/tplx/sprigx/README.adoc[the AsciiDoc rendering^] or by downloading and viewing the https://git.r00t2.io/r00t2/go_goutils/raw/branch/master/tplx/sprigx/README.html[HTML version^]. ==== [id="use"] == How do I Use SprigX? The same way you would `sprig`! [%collapsible] .Like this. ==== [source,go] ---- package main import ( htmlTplLib "html/template" txtTplLib "text/template" "r00t2.io/goutils/tplx/sprigx" ) var ( txtTpl *txtTplLib.Template = txtTplLib. New(""). Funcs( sprigx.TxtFuncMap(), ) htmlTpl *htmlTplLib.Template = htmlTplLib. New(""). Funcs( sprigx.HtmlFuncMap(), ) ) ---- ==== They can even be combined/used together. [%collapsible] .Like this. ==== [source,go] ---- package main import ( "text/template" "github.com/Masterminds/sprig/v3" "r00t2.io/goutils/tplx/sprigx" ) var txtTpl *template.Template = template. New(""). Funcs( sprigx.TxtFuncMap(), ). Funcs( sprig.TxtFuncMap(), ) // Or: /* var txtTpl *template.Template = template. New(""). Funcs( sprig.TxtFuncMap(), ). Funcs( sprigx.TxtFuncMap(), ) */ ---- ==== If a `