summaryrefslogtreecommitdiff
path: root/docs-src/content/functions
diff options
context:
space:
mode:
Diffstat (limited to 'docs-src/content/functions')
-rw-r--r--docs-src/content/functions/func_doc.md.tmpl4
-rw-r--r--docs-src/content/functions/sockaddr.yml11
2 files changed, 10 insertions, 5 deletions
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