summaryrefslogtreecommitdiff
path: root/docs-src/content/functions/filepath.yml
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2023-10-21 13:20:17 -0400
committerGitHub <noreply@github.com>2023-10-21 13:20:17 -0400
commit0bf17db3761018d7ee82f162d00f169e9925205f (patch)
treed0df30dbe5b46b541d5c813533c6d8a34f788988 /docs-src/content/functions/filepath.yml
parenta296ab9796f4452dd4327b6593254848319fb894 (diff)
docs: List release versions for each function, add unreleased label (#1868)
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs-src/content/functions/filepath.yml')
-rw-r--r--docs-src/content/functions/filepath.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs-src/content/functions/filepath.yml b/docs-src/content/functions/filepath.yml
index 84d550d5..239c02a4 100644
--- a/docs-src/content/functions/filepath.yml
+++ b/docs-src/content/functions/filepath.yml
@@ -9,6 +9,7 @@ preamble: |
These functions are wrappers for Go's [`path/filepath`](https://golang.org/pkg/path/filepath/) package.
funcs:
- name: filepath.Base
+ released: v2.7.0
description: |
Returns the last element of path. Trailing path separators are removed before extracting the last element. If the path is empty, Base returns `.`. If the path consists entirely of separators, Base returns a single separator.
@@ -23,6 +24,7 @@ funcs:
$ gomplate -i '{{ filepath.Base "/tmp/foo" }}'
foo
- name: filepath.Clean
+ released: v2.7.0
description: |
Clean returns the shortest path name equivalent to path by purely lexical processing.
@@ -37,6 +39,7 @@ funcs:
$ gomplate -i '{{ filepath.Clean "/tmp//foo/../" }}'
/tmp
- name: filepath.Dir
+ released: v2.7.0
description: |
Returns all but the last element of path, typically the path's directory.
@@ -51,6 +54,7 @@ funcs:
$ gomplate -i '{{ filepath.Dir "/tmp/foo" }}'
/tmp
- name: filepath.Ext
+ released: v2.7.0
description: |
Returns the file name extension used by path.
@@ -65,6 +69,7 @@ funcs:
$ gomplate -i '{{ filepath.Ext "/tmp/foo.csv" }}'
.csv
- name: filepath.FromSlash
+ released: v2.7.0
description: |
Returns the result of replacing each slash (`/`) character in the path with the platform's separator character.
@@ -81,6 +86,7 @@ funcs:
C:\> gomplate.exe -i '{{ filepath.FromSlash "/foo/bar" }}'
C:\foo\bar
- name: filepath.IsAbs
+ released: v2.7.0
description: |
Reports whether the path is absolute.
@@ -97,6 +103,7 @@ funcs:
$ gomplate -i 'the path is {{ if (filepath.IsAbs "../foo.csv") }}absolute{{else}}relative{{end}}'
the path is relative
- name: filepath.Join
+ released: v2.7.0
description: |
Joins any number of path elements into a single path, adding a separator if necessary.
@@ -112,6 +119,7 @@ funcs:
C:\> gomplate.exe -i '{{ filepath.Join "C:\tmp" "foo" "bar" }}'
C:\tmp\foo\bar
- name: filepath.Match
+ released: v2.7.0
description: |
Reports whether name matches the shell file name pattern.
@@ -128,6 +136,7 @@ funcs:
$ gomplate -i '{{ filepath.Match "*.csv" "foo.csv" }}'
true
- name: filepath.Rel
+ released: v2.7.0
description: |
Returns a relative path that is lexically equivalent to targetpath when joined to basepath with an intervening separator.
@@ -144,6 +153,7 @@ funcs:
$ gomplate -i '{{ filepath.Rel "/a" "/a/b/c" }}'
b/c
- name: filepath.Split
+ released: v2.7.0
description: |
Splits path immediately following the final path separator, separating it into a directory and file name component.
@@ -162,6 +172,7 @@ funcs:
C:\> gomplate.exe -i '{{ $p := filepath.Split `C:\tmp\foo` }}{{ $dir := index $p 0 }}{{ $file := index $p 1 }}dir is {{$dir}}, file is {{$file}}'
dir is C:\tmp\, file is foo
- name: filepath.ToSlash
+ released: v2.7.0
description: |
Returns the result of replacing each separator character in path with a slash (`/`) character.
@@ -178,6 +189,7 @@ funcs:
C:\> gomplate.exe -i '{{ filepath.ToSlash `foo\bar\baz` }}'
foo/bar/baz
- name: filepath.VolumeName
+ released: v2.7.0
description: |
Returns the leading volume name. Given `C:\foo\bar` it returns `C:` on Windows. Given a UNC like `\\host\share\foo` it returns `\\host\share`. On other platforms it returns an empty string.