From 9cce861b2ef60cbbccf7c687dd69ec3dc2344417 Mon Sep 17 00:00:00 2001 From: brent saner Date: Wed, 28 Jan 2026 09:16:18 -0500 Subject: [PATCH] v1.16.1 FIXED: * *Some* documentation weirdness on pkg.go dev rendering. It still uses the Markdown render by default, and it seems if you use anchor links in a bulletpoint list, pandoc just says "lol screw you"... ADDED: * tplx/sprigx tpl function `osHostname` --- tplx/sprigx/README.adoc | 182 ++++++++++++++++++++---------------- tplx/sprigx/funcs_tpl_os.go | 13 +++ 2 files changed, 116 insertions(+), 79 deletions(-) create mode 100644 tplx/sprigx/funcs_tpl_os.go diff --git a/tplx/sprigx/README.adoc b/tplx/sprigx/README.adoc index 9b2f63b..7d42724 100644 --- a/tplx/sprigx/README.adoc +++ b/tplx/sprigx/README.adoc @@ -21,11 +21,22 @@ SprigX are extensions to https://masterminds.github.io/sprig/[the `sprig` librar 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] -.The same way you would `sprig`! +.Like this. ==== [source,go] ---- @@ -40,21 +51,23 @@ import ( var ( txtTpl *txtTplLib.Template = txtTplLib. - New(""). - Funcs( - sprigx.TxtFuncMap(), - ) + New(""). + Funcs( + sprigx.TxtFuncMap(), + ) htmlTpl *htmlTplLib.Template = htmlTplLib. - New(""). - Funcs( - sprigx.HtmlFuncMap(), - ) + New(""). + Funcs( + sprigx.HtmlFuncMap(), + ) ) ---- ==== +They can even be combined/used together. + [%collapsible] -.They can even be combined/used together. +.Like this. ==== [source,go] ---- @@ -68,23 +81,23 @@ import ( ) var txtTpl *template.Template = template. - New(""). - Funcs( - sprigx.TxtFuncMap(), - ). - Funcs( - sprig.TxtFuncMap(), - ) + New(""). + Funcs( + sprigx.TxtFuncMap(), + ). + Funcs( + sprig.TxtFuncMap(), + ) // Or: /* var txtTpl *template.Template = template. - New(""). - Funcs( - sprig.TxtFuncMap(), - ). - Funcs( - sprigx.TxtFuncMap(), - ) + New(""). + Funcs( + sprig.TxtFuncMap(), + ). + Funcs( + sprigx.TxtFuncMap(), + ) */ ---- ==== @@ -93,8 +106,42 @@ If a `