From cfc6bdc4ae5677ae742b9270409e9d2f5e6426fd Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sun, 7 May 2023 20:54:47 -0400 Subject: Migrate docs site to new theme Signed-off-by: Dave Henderson --- docs-src/content/functions/func_doc.md.tmpl | 4 ++-- docs-src/content/functions/sockaddr.yml | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'docs-src') diff --git a/docs-src/content/functions/func_doc.md.tmpl b/docs-src/content/functions/func_doc.md.tmpl index 36adc712..9c87dd9f 100644 --- a/docs-src/content/functions/func_doc.md.tmpl +++ b/docs-src/content/functions/func_doc.md.tmpl @@ -3,11 +3,11 @@ {{- define "usage" }}### Usage {{- $arguments := index . "arguments" | default coll.Slice }} {{ if has . "rawUsage" }}{{ .rawUsage | strings.TrimSpace }}{{ else }} -```go +``` {{ .name }}{{ range $a := $arguments }} {{template "argName" $a }}{{end}} ``` {{- if (index . "pipeline" | default false) }} -```go +``` {{ $last := (sub (len $arguments) 1) -}} {{ (index $arguments $last).name }} | {{ .name }}{{ range $i, $a := $arguments }}{{if not (eq $i $last)}} {{template "argName" $a }}{{end}}{{end}} ``` diff --git a/docs-src/content/functions/sockaddr.yml b/docs-src/content/functions/sockaddr.yml index f50af477..5992910c 100644 --- a/docs-src/content/functions/sockaddr.yml +++ b/docs-src/content/functions/sockaddr.yml @@ -15,10 +15,15 @@ preamble: | To demonstrate how this can be used, here's an example that lists all of the IPv4 addresses available on the system: - ```console - $ gomplate -i '{{ range (sockaddr.GetAllInterfaces | sockaddr.Include "type" "ipv4") -}} + _in.tmpl:_ + ``` + {{ range (sockaddr.GetAllInterfaces | sockaddr.Include "type" "ipv4") -}} {{ . | sockaddr.Attr "address" }} - {{end}}' + {{end}} + ``` + + ```console + $ gomplate -f in.tmpl 127.0.0.1 10.0.0.8 132.79.79.79 -- cgit v1.2.3