diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7527eb40b..89d376b76 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -21,3 +21,36 @@ jobs: echo "Function docs are out of date. Please run 'make gen-func-docs' locally and commit the changes." exit 1 fi + muffet: + runs-on: ubuntu-latest + steps: + - name: Hugo setup + uses: peaceiris/actions-hugo@v3.0.0 + with: + # keep this in sync with netlify.toml + hugo-version: '0.128.0' + - uses: actions/checkout@v4 + - name: Install muffet + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release --repo raviqqe/muffet download -p muffet_linux_amd64.tar.gz + tar xvf muffet_linux_amd64.tar.gz muffet + sudo mv muffet /usr/local/bin + - name: Serve the site and check links + run: | + set -ex + + cd docs + hugo --renderToMemory + hugo serve --watch=false --renderToMemory & + sleep 2 + + muffet http://localhost:1313 \ + -r8 --max-connections-per-host=4 --buffer-size=8192 \ + --exclude="https://github\.com.*" \ + --exclude="https://docs\.aws.*" \ + --exclude="https://linux.die\.net.*" \ + --exclude="https://jqplay\.org.*" \ + + kill %1 diff --git a/docs-src/content/functions/aws.yml b/docs-src/content/functions/aws.yml index 722cf5d47..4809b0bb9 100644 --- a/docs-src/content/functions/aws.yml +++ b/docs-src/content/functions/aws.yml @@ -23,7 +23,7 @@ funcs: alias: ec2meta released: v1.8.0 description: | - Queries AWS [EC2 Instance Metadata](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `meta-data` path -- for data in the `dynamic` path use `aws.EC2Dynamic`. + Queries AWS [EC2 Instance Metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `meta-data` path -- for data in the `dynamic` path use `aws.EC2Dynamic`. For times when running outside EC2, or when the metadata API can't be reached, a `default` value can be provided. pipeline: false @@ -42,7 +42,7 @@ funcs: alias: ec2dynamic released: v1.8.0 description: | - Queries AWS [EC2 Instance Dynamic Metadata](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `dynamic` path -- for data in the `meta-data` path use `aws.EC2Meta`. + Queries AWS [EC2 Instance Dynamic Metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `dynamic` path -- for data in the `meta-data` path use `aws.EC2Meta`. For times when running outside EC2, or when the metadata API can't be reached, a `default` value can be provided. pipeline: false @@ -86,7 +86,7 @@ funcs: alias: ec2tag released: v3.8.0 description: | - Queries the AWS EC2 API to find the value of the given [user-defined tag](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). An optional default + Queries the AWS EC2 API to find the value of the given [user-defined tag](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). An optional default can be provided. pipeline: false arguments: @@ -107,7 +107,7 @@ funcs: alias: ec2tags released: v3.8.0 description: | - Queries the AWS EC2 API to find all the tags/values [user-defined tag](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). + Queries the AWS EC2 API to find all the tags/values [user-defined tag](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). pipeline: false arguments: examples: @@ -138,7 +138,7 @@ funcs: See [the AWS documentation](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) for more details. - See also [`aws.KMSDecrypt`](#aws-kmsdecrypt). + See also [`aws.KMSDecrypt`](#awskmsdecrypt). pipeline: true arguments: - name: keyID @@ -162,7 +162,7 @@ funcs: See [the AWS documentation](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) for more details. - See also [`aws.KMSEncrypt`](#aws-kmsencrypt). + See also [`aws.KMSEncrypt`](#awskmsencrypt). pipeline: true arguments: - name: input @@ -179,7 +179,7 @@ funcs: Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html) - See also [`aws.UserID`](#aws-userid) and [`aws.ARN`](#aws-arn). + See also [`aws.UserID`](#awsuserid) and [`aws.ARN`](#awsarn). pipeline: false examples: - | @@ -192,7 +192,7 @@ funcs: Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html) - See also [`aws.UserID`](#aws-userid) and [`aws.Account`](#aws-account). + See also [`aws.UserID`](#awsuserid) and [`aws.Account`](#awsaccount). pipeline: false examples: - | @@ -203,12 +203,12 @@ funcs: description: | Returns the unique identifier of the calling entity. The exact value depends on the type of entity making the call. The values returned are those - listed in the `aws:userid` column in the [Principal table](http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) + listed in the `aws:userid` column in the [Principal table](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) found on the Policy Variables reference page in the IAM User Guide. Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html) - See also [`aws.ARN`](#aws-arn) and [`aws.Account`](#aws-account). + See also [`aws.ARN`](#awsarn) and [`aws.Account`](#awsaccount). pipeline: false examples: - | diff --git a/docs-src/content/functions/base64.yml b/docs-src/content/functions/base64.yml index 6d1c23ed3..d74863ff1 100644 --- a/docs-src/content/functions/base64.yml +++ b/docs-src/content/functions/base64.yml @@ -23,7 +23,7 @@ funcs: Decode a Base64 string. This supports both standard ([RFC4648 §4](https://tools.ietf.org/html/rfc4648#section-4)) and URL-safe ([RFC4648 §5](https://tools.ietf.org/html/rfc4648#section-5)) encodings. This function outputs the data as a string, so it may not be appropriate - for decoding binary data. Use [`base64.DecodeBytes`](#base64.DecodeBytes) + for decoding binary data. Use [`base64.DecodeBytes`](#base64decodebytes) for binary data. pipeline: true arguments: @@ -44,7 +44,7 @@ funcs: This function outputs the data as a byte array, so it's most useful for outputting binary data that will be processed further. - Use [`base64.Decode`](#base64.Decode) to output a plain string. + Use [`base64.Decode`](#base64decode) to output a plain string. pipeline: false arguments: - name: input diff --git a/docs-src/content/functions/coll.yml b/docs-src/content/functions/coll.yml index 16d1dab19..b27f1e2a3 100644 --- a/docs-src/content/functions/coll.yml +++ b/docs-src/content/functions/coll.yml @@ -19,11 +19,11 @@ funcs: All keys are converted to strings. This function is equivalent to [Sprig's `dict`](http://masterminds.github.io/sprig/dicts.html#dict) - function, as used in [Helm templates](https://docs.helm.sh/chart_template_guide#template-functions-and-pipelines). + function, as used in [Helm templates](https://helm.sh/docs/chart_template_guide/functions_and_pipelines/). - For creating more complex maps, see [`data.JSON`](../data/#data-json) or [`data.YAML`](../data/#data-yaml). + For creating more complex maps, see [`data.JSON`](../data/#datajson) or [`data.YAML`](../data/#datayaml). - For creating arrays, see [`coll.Slice`](#coll-slice). + For creating arrays, see [`coll.Slice`](#collslice-_deprecated_). arguments: - name: in... required: true @@ -63,7 +63,7 @@ funcs: - name: coll.GoSlice released: v4.0.0 description: | - This exposes the `slice` function from Go's [`text/template`](https://golang.org/pkg/text/template/#hdr-Functions) + This exposes the `slice` function from Go's [`text/template`](https://pkg.go.dev/text/template/#hdr-Functions) package. Note that using `slice` will use the `coll.Slice` function instead, which may not be desired. For some background on this, see [this issue](https://github.com/hairyhenderson/gomplate/issues/1461). @@ -209,7 +209,7 @@ funcs: The keys will be ordered first by map position (if multiple maps are given), then alphabetically. - See also [`coll.Values`](#coll-values). + See also [`coll.Values`](#collvalues). pipeline: true arguments: - name: in... @@ -230,7 +230,7 @@ funcs: The values will be ordered first by map position (if multiple maps are given), then alphabetically by key. - See also [`coll.Keys`](#coll-keys). + See also [`coll.Keys`](#collkeys). pipeline: true arguments: - name: in... @@ -250,7 +250,7 @@ funcs: _Note that this function does not change the given list; it always produces a new one._ - See also [`coll.Prepend`](#coll-prepend). + See also [`coll.Prepend`](#collprepend). pipeline: true arguments: - name: value @@ -271,7 +271,7 @@ funcs: _Note that this function does not change the given list; it always produces a new one._ - See also [`coll.Append`](#coll-append). + See also [`coll.Append`](#collappend). pipeline: true arguments: - name: value @@ -412,7 +412,7 @@ funcs: The keys can either be separate arguments, or a slice (since v4.0.0). - This is the inverse of [`coll.Omit`](#coll-omit). + This is the inverse of [`coll.Omit`](#collomit). _Note that this function does not modify the input._ pipeline: true @@ -440,7 +440,7 @@ funcs: The keys can either be separate arguments, or a slice (since v4.0.0). - This is the inverse of [`coll.Pick`](#coll-pick). + This is the inverse of [`coll.Pick`](#collpick). _Note that this function does not modify the input._ pipeline: true diff --git a/docs-src/content/functions/conv.yml b/docs-src/content/functions/conv.yml index 237af8e55..31fca92f8 100644 --- a/docs-src/content/functions/conv.yml +++ b/docs-src/content/functions/conv.yml @@ -8,7 +8,7 @@ funcs: alias: bool released: v0.2.0 description: | - **Note:** See also [`conv.ToBool`](#conv-tobool) for a more flexible variant. + **Note:** See also [`conv.ToBool`](#convtobool) for a more flexible variant. Converts a true-ish string to a boolean. Can be used to simplify conditional statements based on environment variables or other text input. pipeline: true @@ -38,7 +38,7 @@ funcs: Note that this will not provide a default for the case where the input is undefined (i.e. referencing things like `.foo` where there is no `foo` field of `.`), but - [`conv.Has`](#conv-has) can be used for that. + [`coll.Has`](../coll/#collhas) can be used for that. pipeline: true arguments: - name: default @@ -52,7 +52,7 @@ funcs: $ gomplate -i '{{ "" | default "foo" }} {{ "bar" | default "baz" }}' foo bar - name: conv.Dict - deprecated: Renamed to [`coll.Dict`](#coll-dict) + deprecated: Renamed to [`coll.Dict`](../coll/#colldict) alias: dict released: v3.0.0 description: | @@ -64,11 +64,11 @@ funcs: All keys are converted to strings. This function is equivalent to [Sprig's `dict`](http://masterminds.github.io/sprig/dicts.html#dict) - function, as used in [Helm templates](https://docs.helm.sh/chart_template_guide#template-functions-and-pipelines). + function, as used in [Helm templates](https://helm.sh/docs/chart_template_guide/functions_and_pipelines/). - For creating more complex maps, see [`data.JSON`](../data/#data-json) or [`data.YAML`](../data/#data-yaml). + For creating more complex maps, see [`data.JSON`](../data/#datajson) or [`data.YAML`](../data/#datayaml). - For creating arrays, see [`coll.Slice`](#coll-slice). + For creating arrays, see [`coll.Slice`](../coll/#collslice-_deprecated_). arguments: - name: in... required: true @@ -89,7 +89,7 @@ funcs: Hello world! Hello everybody! - name: conv.Slice - deprecated: Renamed to [`coll.Slice`](#coll-slice) + deprecated: Renamed to [`coll.Slice`](../coll/#collslice-_deprecated_) alias: slice released: v0.3.0 description: | @@ -106,7 +106,7 @@ funcs: Hello, Lisa Hello, Maggie - name: conv.Has - deprecated: Renamed to [`coll.Has`](#coll-has) + deprecated: Renamed to [`coll.Has`](../coll/#collhas) alias: has released: v1.5.0 description: | @@ -153,7 +153,7 @@ funcs: alias: urlParse released: v2.0.0 description: | - Parses a string as a URL for later use. Equivalent to [url.Parse](https://golang.org/pkg/net/url/#Parse) + Parses a string as a URL for later use. Equivalent to [url.Parse](https://pkg.go.dev/net/url/#Parse) Any of `url.URL`'s methods can be called on the result. arguments: @@ -185,9 +185,9 @@ funcs: - name: conv.ParseInt released: v1.4.0 description: | - _**Note:**_ See [`conv.ToInt64`](#conv-toint64) instead for a simpler and more flexible variant of this function. + _**Note:**_ See [`conv.ToInt64`](#convtoint64) instead for a simpler and more flexible variant of this function. - Parses a string as an int64. Equivalent to [strconv.ParseInt](https://golang.org/pkg/strconv/#ParseInt) + Parses a string as an int64. Equivalent to [strconv.ParseInt](https://pkg.go.dev/strconv/#ParseInt) rawExamples: - | _`input.tmpl`:_ @@ -204,9 +204,9 @@ funcs: - name: conv.ParseFloat released: v1.4.0 description: | - _**Note:**_ See [`conv.ToFloat`](#conv-tofloat) instead for a simpler and more flexible variant of this function. + _**Note:**_ See [`conv.ToFloat64`](#convtofloat64) instead for a simpler and more flexible variant of this function. - Parses a string as an float64 for later use. Equivalent to [strconv.ParseFloat](https://golang.org/pkg/strconv/#ParseFloat) + Parses a string as an float64 for later use. Equivalent to [strconv.ParseFloat](https://pkg.go.dev/strconv/#ParseFloat) rawExamples: - | _`input.tmpl`:_ @@ -224,7 +224,7 @@ funcs: - name: conv.ParseUint released: v1.4.0 description: | - Parses a string as an uint64 for later use. Equivalent to [strconv.ParseUint](https://golang.org/pkg/strconv/#ParseUint) + Parses a string as an uint64 for later use. Equivalent to [strconv.ParseUint](https://pkg.go.dev/strconv/#ParseUint) rawExamples: - | _`input.tmpl`:_ @@ -241,9 +241,9 @@ funcs: - name: conv.Atoi released: v1.4.0 description: | - _**Note:**_ See [`conv.ToInt`](#conv-toint) and [`conv.ToInt64`](#conv-toint64) instead for simpler and more flexible variants of this function. + _**Note:**_ See [`conv.ToInt`](#convtoint) and [`conv.ToInt64`](#convtoint64) instead for simpler and more flexible variants of this function. - Parses a string as an int for later use. Equivalent to [strconv.Atoi](https://golang.org/pkg/strconv/#Atoi) + Parses a string as an int for later use. Equivalent to [strconv.Atoi](https://pkg.go.dev/strconv/#Atoi) rawExamples: - | _`input.tmpl`:_ @@ -324,7 +324,7 @@ funcs: released: v2.2.0 description: | Converts the input to an `int` (signed integer, 32- or 64-bit depending - on platform). This is similar to [`conv.ToInt64`](#conv-toint64) on 64-bit + on platform). This is similar to [`conv.ToInt64`](#convtoint64) on 64-bit platforms, but is useful when input to another function must be provided as an `int`. @@ -335,7 +335,7 @@ funcs: [CWE-190](https://cwe.mitre.org/data/definitions/190.html) and [CWE-681](https://cwe.mitre.org/data/definitions/681.html). - See also [`conv.ToInt64`](#conv-toint64). + See also [`conv.ToInt64`](#convtoint64). arguments: - name: in required: true @@ -357,7 +357,7 @@ funcs: Unconvertable inputs will result in errors. - This delegates to [`conv.ToInt64`](#conv-toint64) for each input argument. + This delegates to [`conv.ToInt64`](#convtoint64) for each input argument. arguments: - name: in... required: true @@ -373,7 +373,7 @@ funcs: Unconvertable inputs will result in errors. - This delegates to [`conv.ToInt`](#conv-toint) for each input argument. + This delegates to [`conv.ToInt`](#convtoint) for each input argument. arguments: - name: in... required: true @@ -409,7 +409,7 @@ funcs: Unconvertable inputs will result in errors. - This delegates to [`conv.ToFloat64`](#conv-tofloat64) for each input argument. + This delegates to [`conv.ToFloat64`](#convtofloat64) for each input argument. arguments: - name: in... required: true @@ -441,7 +441,7 @@ funcs: description: | Converts the inputs (of any type) to an array of `string`s - This delegates to [`conv.ToString`](#conv-tostring) for each input argument. + This delegates to [`conv.ToString`](#convtostring) for each input argument. arguments: - name: in... required: true diff --git a/docs-src/content/functions/crypto.yml b/docs-src/content/functions/crypto.yml index adbcb1b07..ee7f4c5d3 100644 --- a/docs-src/content/functions/crypto.yml +++ b/docs-src/content/functions/crypto.yml @@ -37,7 +37,7 @@ funcs: This function prints the output as a string. Note that this may result in unreadable text if the decrypted payload is binary. See - [`crypto.DecryptAESBytes`](#crypto.DecryptAESBytes) for another method. + [`crypto.DecryptAESBytes`](#cryptodecryptaesbytes-_experimental_) for another method. This function is suitable for decrypting data that was encrypted by Helm's `encryptAES` function, when the input is base64-decoded, and when @@ -242,14 +242,14 @@ funcs: description: | Decrypt an RSA-encrypted input and print the output as a string. Note that this may result in unreadable text if the decrypted payload is binary. See - [`crypto.RSADecryptBytes`](#crypto.RSADecryptBytes) for a safer method. + [`crypto.RSADecryptBytes`](#cryptorsadecryptbytes-_experimental_) for a safer method. The private key must be a PEM-encoded RSA private key in PKCS#1, ASN.1 DER form, which typically begins with `-----BEGIN RSA PRIVATE KEY-----`. The input text must be plain ciphertext, as a byte array, or safely convertible to a byte array. To decrypt base64-encoded input, you must - first decode with the [`base64.DecodeBytes`](../base64/#base64.DecodeBytes) + first decode with the [`base64.DecodeBytes`](../base64/#base64decodebytes) function. pipeline: true arguments: @@ -281,10 +281,10 @@ funcs: The input text must be plain ciphertext, as a byte array, or safely convertible to a byte array. To decrypt base64-encoded input, you must - first decode with the [`base64.DecodeBytes`](../base64/#base64.DecodeBytes) + first decode with the [`base64.DecodeBytes`](../base64/#base64decodebytes) function. - See [`crypto.RSADecrypt`](#crypto.RSADecrypt) for a function that outputs + See [`crypto.RSADecrypt`](#cryptorsadecrypt-_experimental_) for a function that outputs a string. pipeline: true arguments: @@ -319,13 +319,13 @@ funcs: ASN.1 DER form are also supported (beginning with `RSA PUBLIC KEY`). The output will not be encoded, so consider - [base64-encoding](../base64/#base64.Encode) it for display. + [base64-encoding](../base64/#base64encode) it for display. _Note:_ Output encrypted with this function will _not_ be deterministic, so encrypting the same input twice will not result in the same ciphertext. _Warning:_ Using this function may not be safe. See the warning on Go's - [`rsa.EncryptPKCS1v15`](https://golang.org/pkg/crypto/rsa/#EncryptPKCS1v15) + [`rsa.EncryptPKCS1v15`](https://pkg.go.dev/crypto/rsa/#EncryptPKCS1v15) documentation. pipeline: true arguments: @@ -461,7 +461,7 @@ funcs: - name: crypto.WPAPSK released: v2.3.0 description: | - This is really an alias to [`crypto.PBKDF2`](#crypto.PBKDF2) with the + This is really an alias to [`crypto.PBKDF2`](#cryptopbkdf2) with the values necessary to convert ASCII passphrases to the WPA pre-shared keys for use with WiFi networks. This can be used, for example, to help generate a configuration for [wpa_supplicant](http://w1.fi/wpa_supplicant/). diff --git a/docs-src/content/functions/data.yml b/docs-src/content/functions/data.yml index 6753cafe0..eaa3b0ce6 100644 --- a/docs-src/content/functions/data.yml +++ b/docs-src/content/functions/data.yml @@ -6,7 +6,7 @@ funcs: alias: ds released: v0.5.0 description: | - Parses a given datasource (provided by the [`--datasource/-d`](../../usage/#datasource-d) argument or [`defineDatasource`](#definedatasource)). + Parses a given datasource (provided by the [`--datasource/-d`](../../usage/#--datasource-d) argument or [`defineDatasource`](#definedatasource)). If the `alias` is undefined, but is a valid URL, `datasource` will dynamically read from that URL. @@ -34,7 +34,7 @@ funcs: released: v1.3.0 description: | Tests whether or not a given datasource was defined on the commandline (with the - [`--datasource/-d`](../../usage/#datasource-d) argument). This is intended mainly to allow + [`--datasource/-d`](../../usage/#--datasource-d) argument). This is intended mainly to allow a template to be rendered differently whether or not a given datasource was defined. @@ -78,7 +78,7 @@ funcs: - name: defineDatasource released: v2.7.0 description: | - Define a datasource alias with target URL inside the template. Overridden by the [`--datasource/-d`](../../usage/#datasource-d) flag. + Define a datasource alias with target URL inside the template. Overridden by the [`--datasource/-d`](../../usage/#--datasource-d) flag. Note: once a datasource is defined, it can not be redefined (i.e. if this function is called twice with the same alias, only the first applies). @@ -109,14 +109,14 @@ funcs: - name: include released: v1.8.0 description: | - Includes the content of a given datasource (provided by the [`--datasource/-d`](../../usage/#datasource-d) argument). + Includes the content of a given datasource (provided by the [`--datasource/-d`](../../usage/#--datasource-d) argument). This is similar to [`datasource`](#datasource), except that the data is not parsed. There is no restriction on the type of data included, except that it should be textual. pipeline: false arguments: - name: alias required: true - description: the datasource alias, as provided by [`--datasource/-d`](../../usage/#datasource-d) + description: the datasource alias, as provided by [`--datasource/-d`](../../usage/#--datasource-d) - name: subpath required: false description: the subpath to use, if supported by the datasource @@ -151,7 +151,7 @@ funcs: Converts a JSON string into an object. Works for JSON Objects, but will also parse JSON Arrays. Will not parse other valid JSON types. - For more explict JSON Array support, see [`data.JSONArray`](#data-jsonarray). + For more explict JSON Array support, see [`data.JSONArray`](#datajsonarray). #### Encrypted JSON support (EJSON) @@ -206,7 +206,7 @@ funcs: Converts a YAML string into an object. Works for YAML Objects but will also parse YAML Arrays. This can be used to access properties of YAML objects. - For more explict YAML Array support, see [`data.JSONArray`](#data-yamlarray). + For more explict YAML Array support, see [`data.JSONArray`](#datayamlarray). pipeline: true arguments: - name: in @@ -352,7 +352,7 @@ funcs: alias: csvByColumn released: v2.0.0 description: | - Like [`csvByRow`](#csvByRow), except that the data is presented as a columnar + Like [`csvByRow`](#datacsvbyrow), except that the data is presented as a columnar (column-oriented) map. pipeline: true arguments: @@ -434,7 +434,7 @@ funcs: Converts an object to a pretty-printed (or _indented_) JSON document. Input objects may be the result of functions like `data.JSON`, `data.YAML`, `data.JSONArray`, or `data.YAMLArray` functions, or they could be provided - by a [`datasource`](../general/datasource). + by a [`datasource`](../datasources). The indent string must be provided as an argument. pipeline: true @@ -464,7 +464,7 @@ funcs: description: | Converts an object to a YAML document. Input objects may be the result of `data.JSON`, `data.YAML`, `data.JSONArray`, or `data.YAMLArray` functions, - or they could be provided by a [`datasource`](../general/datasource). + or they could be provided by a [`datasource`](../datasources). pipeline: true arguments: - name: obj @@ -502,14 +502,14 @@ funcs: released: v2.0.0 description: | Converts an object to a CSV document. The input object must be a 2-dimensional - array of strings (a `[][]string`). Objects produced by [`data.CSVByRow`](#conv-csvbyrow) - and [`data.CSVByColumn`](#conv-csvbycolumn) cannot yet be converted back to CSV documents. + array of strings (a `[][]string`). Objects produced by [`data.CSVByRow`](#datacsvbyrow) + and [`data.CSVByColumn`](#datacsvbycolumn) cannot yet be converted back to CSV documents. **Note:** With the exception that a custom delimiter can be used, `data.ToCSV` outputs according to the [RFC 4180](https://tools.ietf.org/html/rfc4180) format, which means that line terminators are `CRLF` (Windows format, or `\r\n`). If you require `LF` (UNIX format, or `\n`), the output can be piped through - [`strings.ReplaceAll`](../strings/#strings-replaceall) to replace `"\r\n"` with `"\n"`. + [`strings.ReplaceAll`](../strings/#stringsreplaceall) to replace `"\r\n"` with `"\n"`. pipeline: true arguments: - name: delim diff --git a/docs-src/content/functions/env.yml b/docs-src/content/functions/env.yml index 1222ac7ed..8ff0c7ac1 100644 --- a/docs-src/content/functions/env.yml +++ b/docs-src/content/functions/env.yml @@ -7,7 +7,7 @@ funcs: alias: getenv released: v0.2.0 description: | - Exposes the [os.Getenv](https://golang.org/pkg/os/#Getenv) function. + Exposes the [os.Getenv](https://pkg.go.dev/os/#Getenv) function. Retrieves the value of the environment variable named by the key. If the variable is unset, but the same variable ending in `_FILE` is set, the contents @@ -42,12 +42,12 @@ funcs: - name: env.ExpandEnv released: v2.5.0 description: | - Exposes the [os.ExpandEnv](https://golang.org/pkg/os/#ExpandEnv) function. + Exposes the [os.ExpandEnv](https://pkg.go.dev/os/#ExpandEnv) function. Replaces `${var}` or `$var` in the input string according to the values of the current environment variables. References to undefined variables are replaced by the empty string. - Like [`env.Getenv`](#env-getenv), the `_FILE` variant of a variable is used. + Like [`env.Getenv`](#envgetenv), the `_FILE` variant of a variable is used. pipeline: false arguments: - name: input diff --git a/docs-src/content/functions/file.yml b/docs-src/content/functions/file.yml index 3e8f5ed48..855480e03 100644 --- a/docs-src/content/functions/file.yml +++ b/docs-src/content/functions/file.yml @@ -87,9 +87,9 @@ funcs: - name: file.Stat released: v2.4.0 description: | - Returns a [`os.FileInfo`](https://golang.org/pkg/os/#FileInfo) describing the named path. + Returns a [`os.FileInfo`](https://pkg.go.dev/os/#FileInfo) describing the named path. - Essentially a wrapper for Go's [`os.Stat`](https://golang.org/pkg/os/#Stat) function. + Essentially a wrapper for Go's [`os.Stat`](https://pkg.go.dev/os/#Stat) function. pipeline: true arguments: - name: path @@ -103,13 +103,13 @@ funcs: - name: file.Walk released: v2.6.0 description: | - Like a recursive [`file.ReadDir`](#file-readdir), recursively walks the file tree rooted at `path`, and returns an array of all files and directories contained within. + Like a recursive [`file.ReadDir`](#filereaddir), recursively walks the file tree rooted at `path`, and returns an array of all files and directories contained within. The files are walked in lexical order, which makes the output deterministic but means that for very large directories can be inefficient. Walk does not follow symbolic links. - Similar to Go's [`filepath.Walk`](https://golang.org/pkg/path/filepath/#Walk) function. + Similar to Go's [`filepath.Walk`](https://pkg.go.dev/path/filepath/#Walk) function. pipeline: true arguments: - name: path diff --git a/docs-src/content/functions/filepath.yml b/docs-src/content/functions/filepath.yml index 239c02a4c..69b65c0ca 100644 --- a/docs-src/content/functions/filepath.yml +++ b/docs-src/content/functions/filepath.yml @@ -6,14 +6,14 @@ preamble: | This page documents the `filepath` namespace - see also the [`path`](../path) documentation. - These functions are wrappers for Go's [`path/filepath`](https://golang.org/pkg/path/filepath/) package. + These functions are wrappers for Go's [`path/filepath`](https://pkg.go.dev/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. - A wrapper for Go's [`filepath.Base`](https://golang.org/pkg/path/filepath/#Base) function. + A wrapper for Go's [`filepath.Base`](https://pkg.go.dev/path/filepath/#Base) function. pipeline: true arguments: - name: path @@ -28,7 +28,7 @@ funcs: description: | Clean returns the shortest path name equivalent to path by purely lexical processing. - A wrapper for Go's [`filepath.Clean`](https://golang.org/pkg/path/filepath/#Clean) function. + A wrapper for Go's [`filepath.Clean`](https://pkg.go.dev/path/filepath/#Clean) function. pipeline: true arguments: - name: path @@ -43,7 +43,7 @@ funcs: description: | Returns all but the last element of path, typically the path's directory. - A wrapper for Go's [`filepath.Dir`](https://golang.org/pkg/path/filepath/#Dir) function. + A wrapper for Go's [`filepath.Dir`](https://pkg.go.dev/path/filepath/#Dir) function. pipeline: true arguments: - name: path @@ -58,7 +58,7 @@ funcs: description: | Returns the file name extension used by path. - A wrapper for Go's [`filepath.Ext`](https://golang.org/pkg/path/filepath/#Ext) function. + A wrapper for Go's [`filepath.Ext`](https://pkg.go.dev/path/filepath/#Ext) function. pipeline: true arguments: - name: path @@ -73,7 +73,7 @@ funcs: description: | Returns the result of replacing each slash (`/`) character in the path with the platform's separator character. - A wrapper for Go's [`filepath.FromSlash`](https://golang.org/pkg/path/filepath/#FromSlash) function. + A wrapper for Go's [`filepath.FromSlash`](https://pkg.go.dev/path/filepath/#FromSlash) function. pipeline: true arguments: - name: path @@ -90,7 +90,7 @@ funcs: description: | Reports whether the path is absolute. - A wrapper for Go's [`filepath.IsAbs`](https://golang.org/pkg/path/filepath/#IsAbs) function. + A wrapper for Go's [`filepath.IsAbs`](https://pkg.go.dev/path/filepath/#IsAbs) function. pipeline: true arguments: - name: path @@ -107,7 +107,7 @@ funcs: description: | Joins any number of path elements into a single path, adding a separator if necessary. - A wrapper for Go's [`filepath.Join`](https://golang.org/pkg/path/filepath/#Join) function. + A wrapper for Go's [`filepath.Join`](https://pkg.go.dev/path/filepath/#Join) function. arguments: - name: elem... required: true @@ -123,7 +123,7 @@ funcs: description: | Reports whether name matches the shell file name pattern. - A wrapper for Go's [`filepath.Match`](https://golang.org/pkg/path/filepath/#Match) function. + A wrapper for Go's [`filepath.Match`](https://pkg.go.dev/path/filepath/#Match) function. arguments: - name: pattern required: true @@ -140,7 +140,7 @@ funcs: description: | Returns a relative path that is lexically equivalent to targetpath when joined to basepath with an intervening separator. - A wrapper for Go's [`filepath.Rel`](https://golang.org/pkg/path/filepath/#Rel) function. + A wrapper for Go's [`filepath.Rel`](https://pkg.go.dev/path/filepath/#Rel) function. arguments: - name: basepath required: true @@ -159,7 +159,7 @@ funcs: The function returns an array with two values, the first being the diretory, and the second the file. - A wrapper for Go's [`filepath.Split`](https://golang.org/pkg/path/filepath/#Split) function. + A wrapper for Go's [`filepath.Split`](https://pkg.go.dev/path/filepath/#Split) function. pipeline: true arguments: - name: path @@ -176,7 +176,7 @@ funcs: description: | Returns the result of replacing each separator character in path with a slash (`/`) character. - A wrapper for Go's [`filepath.ToSlash`](https://golang.org/pkg/path/filepath/#ToSlash) function. + A wrapper for Go's [`filepath.ToSlash`](https://pkg.go.dev/path/filepath/#ToSlash) function. pipeline: true arguments: - name: path @@ -193,7 +193,7 @@ funcs: 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. - A wrapper for Go's [`filepath.VolumeName`](https://golang.org/pkg/path/filepath/#VolumeName) function. + A wrapper for Go's [`filepath.VolumeName`](https://pkg.go.dev/path/filepath/#VolumeName) function. pipeline: true arguments: - name: path diff --git a/docs-src/content/functions/math.yml b/docs-src/content/functions/math.yml index d375ae025..53f14103f 100644 --- a/docs-src/content/functions/math.yml +++ b/docs-src/content/functions/math.yml @@ -52,7 +52,7 @@ funcs: - name: math.Ceil released: v2.6.0 description: | - Returns the least integer value greater than or equal to a given floating-point number. This wraps Go's [`math.Ceil`](https://golang.org/pkg/math/#Ceil). + Returns the least integer value greater than or equal to a given floating-point number. This wraps Go's [`math.Ceil`](https://pkg.go.dev/math/#Ceil). **Note:** the return value of this function is a `float64` so that the special-cases `NaN` and `Inf` can be returned appropriately. arguments: @@ -89,7 +89,7 @@ funcs: - name: math.Floor released: v2.6.0 description: | - Returns the greatest integer value less than or equal to a given floating-point number. This wraps Go's [`math.Floor`](https://golang.org/pkg/math/#Floor). + Returns the greatest integer value less than or equal to a given floating-point number. This wraps Go's [`math.Floor`](https://pkg.go.dev/math/#Floor). **Note:** the return value of this function is a `float64` so that the special-cases `NaN` and `Inf` can be returned appropriately. arguments: @@ -154,7 +154,7 @@ funcs: - name: math.Max released: v2.6.0 description: | - Returns the largest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Max`](https://golang.org/pkg/math/#Max) are followed. + Returns the largest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Max`](https://pkg.go.dev/math/#Max) are followed. arguments: - name: nums... required: true @@ -166,7 +166,7 @@ funcs: - name: math.Min released: v2.6.0 description: | - Returns the smallest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Min`](https://golang.org/pkg/math/#Min) are followed. + Returns the smallest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Min`](https://pkg.go.dev/math/#Min) are followed. arguments: - name: nums... required: true @@ -192,7 +192,7 @@ funcs: alias: pow released: v2.2.0 description: | - Calculate an exponent - _bn_. This wraps Go's [`math.Pow`](https://golang.org/pkg/math/#Pow). If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. + Calculate an exponent - _bn_. This wraps Go's [`math.Pow`](https://pkg.go.dev/math/#Pow). If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. arguments: - name: b required: true diff --git a/docs-src/content/functions/net.yml b/docs-src/content/functions/net.yml index 4afa5689c..1150cd486 100644 --- a/docs-src/content/functions/net.yml +++ b/docs-src/content/functions/net.yml @@ -58,11 +58,11 @@ funcs: Resolve a DNS [`SRV` service record](https://en.wikipedia.org/wiki/SRV_record). This implementation supports the canonical [RFC2782](https://tools.ietf.org/html/rfc2782) form (i.e. `_Service._Proto.Name`), but other forms are also supported, such as - those served by [Consul's DNS interface](https://www.consul.io/docs/agent/dns.html#standard-lookup). + those served by [Consul's DNS interface](https://developer.hashicorp.com/consul/docs/services/discovery/dns-dynamic-lookups#standard-lookup). When multiple records are returned, this function returns the first. - A [`net.SRV`](https://golang.org/pkg/net/#SRV) data structure is returned. The + A [`net.SRV`](https://pkg.go.dev/net/#SRV) data structure is returned. The following properties are available: - `Target` - _(string)_ the hostname where the service can be reached - `Port` - _(uint16)_ the service's port @@ -87,11 +87,11 @@ funcs: Resolve a DNS [`SRV` service record](https://en.wikipedia.org/wiki/SRV_record). This implementation supports the canonical [RFC2782](https://tools.ietf.org/html/rfc2782) form (i.e. `_Service._Proto.Name`), but other forms are also supported, such as - those served by [Consul's DNS interface](https://www.consul.io/docs/agent/dns.html#standard-lookup). + those served by [Consul's DNS interface](https://developer.hashicorp.com/consul/docs/services/discovery/dns-dynamic-lookups#standard-lookup). This function returns all available SRV records. - An array of [`net.SRV`](https://golang.org/pkg/net/#SRV) data structures is + An array of [`net.SRV`](https://pkg.go.dev/net/#SRV) data structures is returned. For each element, the following properties are available: - `Target` - _(string)_ the hostname where the service can be reached - `Port` - _(uint16)_ the service's port @@ -154,7 +154,7 @@ funcs: 93.176.0.0/12 - name: net.ParseIP released: v3.10.0 - deprecated: Use [`net.ParseAddr`](#net-parseaddr) instead. + deprecated: Use [`net.ParseAddr`](#netparseaddr) instead. description: | Parse the given string as an IP address (a `netaddr.IP` from the [`inet.af/netaddr`](https://pkg.go.dev/inet.af/netaddr) package). @@ -199,7 +199,7 @@ funcs: true - name: net.ParseIPPrefix released: v3.10.0 - deprecated: Use [`net.ParsePrefix`](#net-parseprefix) instead. + deprecated: Use [`net.ParsePrefix`](#netparseprefix) instead. description: | Parse the given string as an IP address prefix (CIDR) representing an IP network (a `netaddr.IPPrefix` from the @@ -257,7 +257,7 @@ funcs: [1.2.3.0/25 1.2.3.128/26 1.2.3.192/27 1.2.3.224/29 1.2.3.232/31] - name: net.ParseIPRange released: v3.10.0 - deprecated: Use [`net.ParseRange`](#net-parserange) instead. + deprecated: Use [`net.ParseRange`](#netparserange-_experimental_) instead. description: | Parse the given string as an inclusive range of IP addresses from the same address family (a `netaddr.IPRange` from the [`inet.af/netaddr`][] package). diff --git a/docs-src/content/functions/path.yml b/docs-src/content/functions/path.yml index 15a5aba3c..1ffdf5e90 100644 --- a/docs-src/content/functions/path.yml +++ b/docs-src/content/functions/path.yml @@ -6,14 +6,14 @@ preamble: | This page documents the `path` namespace - see also the [`filepath`](../filepath) documentation. - These functions are wrappers for Go's [`path`](https://golang.org/pkg/path/) and [`path/filepath`](https://golang.org/pkg/path/filepath/) packages. + These functions are wrappers for Go's [`path`](https://pkg.go.dev/path/) and [`path/filepath`](https://pkg.go.dev/path/filepath/) packages. funcs: - name: path.Base released: v2.7.0 description: | Returns the last element of path. Trailing slashes are removed before extracting the last element. If the path is empty, Base returns `.`. If the path consists entirely of slashes, Base returns `/`. - A wrapper for Go's [`path.Base`](https://golang.org/pkg/path/#Base) function. + A wrapper for Go's [`path.Base`](https://pkg.go.dev/path/#Base) function. pipeline: true arguments: - name: path @@ -28,7 +28,7 @@ funcs: description: | Clean returns the shortest path name equivalent to path by purely lexical processing. - A wrapper for Go's [`path.Clean`](https://golang.org/pkg/path/#Clean) function. + A wrapper for Go's [`path.Clean`](https://pkg.go.dev/path/#Clean) function. pipeline: true arguments: - name: path @@ -43,7 +43,7 @@ funcs: description: | Returns all but the last element of path, typically the path's directory. - A wrapper for Go's [`path.Dir`](https://golang.org/pkg/path/#Dir) function. + A wrapper for Go's [`path.Dir`](https://pkg.go.dev/path/#Dir) function. pipeline: true arguments: - name: path @@ -58,7 +58,7 @@ funcs: description: | Returns the file name extension used by path. - A wrapper for Go's [`path.Ext`](https://golang.org/pkg/path/#Ext) function. + A wrapper for Go's [`path.Ext`](https://pkg.go.dev/path/#Ext) function. pipeline: true arguments: - name: path @@ -73,7 +73,7 @@ funcs: description: | Reports whether the path is absolute. - A wrapper for Go's [`path.IsAbs`](https://golang.org/pkg/path/#IsAbs) function. + A wrapper for Go's [`path.IsAbs`](https://pkg.go.dev/path/#IsAbs) function. pipeline: true arguments: - name: path @@ -90,7 +90,7 @@ funcs: description: | Joins any number of path elements into a single path, adding a separating slash if necessary. - A wrapper for Go's [`path.Join`](https://golang.org/pkg/path/#Join) function. + A wrapper for Go's [`path.Join`](https://pkg.go.dev/path/#Join) function. arguments: - name: elem... required: true @@ -104,7 +104,7 @@ funcs: description: | Reports whether name matches the shell file name pattern. - A wrapper for Go's [`path.Match`](https://golang.org/pkg/path/#Match) function. + A wrapper for Go's [`path.Match`](https://pkg.go.dev/path/#Match) function. arguments: - name: pattern required: true @@ -123,7 +123,7 @@ funcs: The function returns an array with two values, the first being the directory, and the second the file. - A wrapper for Go's [`path.Split`](https://golang.org/pkg/path/#Split) function. + A wrapper for Go's [`path.Split`](https://pkg.go.dev/path/#Split) function. pipeline: true arguments: - name: path diff --git a/docs-src/content/functions/random.yml b/docs-src/content/functions/random.yml index 9f5a0414d..38e50a779 100644 --- a/docs-src/content/functions/random.yml +++ b/docs-src/content/functions/random.yml @@ -5,7 +5,7 @@ preamble: | ### About randomness - `gomplate` uses Go's [`math/rand`](https://golang.org/pkg/math/rand/) package + `gomplate` uses Go's [`math/rand`](https://pkg.go.dev/math/rand/) package to generate pseudo-random numbers. Note that these functions are not suitable for use in security-sensitive applications, such as cryptography. However, these functions will not deplete system entropy. diff --git a/docs-src/content/functions/regexp.yml b/docs-src/content/functions/regexp.yml index 85df21080..acd6ef4f7 100644 --- a/docs-src/content/functions/regexp.yml +++ b/docs-src/content/functions/regexp.yml @@ -2,7 +2,7 @@ ns: regexp preamble: | These functions allow user you to search and modify text with regular expressions. - The syntax of the regular expressions accepted is [Go's `regexp` syntax](https://golang.org/pkg/regexp/syntax/#hdr-Syntax), + The syntax of the regular expressions accepted is [Go's `regexp` syntax](https://pkg.go.dev/regexp/syntax/#hdr-Syntax), and is the same general syntax used by Perl, Python, and other languages. funcs: - name: regexp.Find @@ -12,7 +12,7 @@ funcs: of the regular expression `expression`. This function provides the same behaviour as Go's - [`regexp.FindString`](https://golang.org/pkg/regexp/#Regexp.FindString) function. + [`regexp.FindString`](https://pkg.go.dev/regexp/#Regexp.FindString) function. pipeline: true arguments: - name: expression @@ -38,7 +38,7 @@ funcs: to be returned. This function provides the same behaviour as Go's - [`regexp.FindAllString`](https://golang.org/pkg/regexp/#Regexp.FindAllString) function. + [`regexp.FindAllString`](https://pkg.go.dev/regexp#Regexp.FindAllString) function. pipeline: true arguments: - name: expression @@ -81,7 +81,7 @@ funcs: Escapes all regular expression metacharacters in the input. The returned string is a regular expression matching the literal text. This function provides the same behaviour as Go's - [`regexp.QuoteMeta`](https://golang.org/pkg/regexp/#Regexp.QuoteMeta) function. + [`regexp.QuoteMeta`](https://pkg.go.dev/regexp#QuoteMeta) function. pipeline: true arguments: - name: input @@ -99,7 +99,7 @@ funcs: The replacement is substituted after expanding variables beginning with `$`. This function provides the same behaviour as Go's - [`regexp.ReplaceAllString`](https://golang.org/pkg/regexp/#Regexp.ReplaceAllString) function. + [`regexp.ReplaceAllString`](https://pkg.go.dev/regexp/#Regexp.ReplaceAllString) function. pipeline: true arguments: - name: expression @@ -127,7 +127,7 @@ funcs: beginning with `$`. This function provides the same behaviour as Go's - [`regexp.ReplaceAllLiteralString`](https://golang.org/pkg/regexp/#Regexp.ReplaceAllLiteralString) function. + [`regexp.ReplaceAllLiteralString`](https://pkg.go.dev/regexp/#Regexp.ReplaceAllLiteralString) function. pipeline: true arguments: - name: expression @@ -155,11 +155,11 @@ funcs: `n` argument (number of matches) will be set to `-1`, causing all sub-strings to be returned. - This is equivalent to [`strings.SplitN`](../strings/#strings-splitn), + This is equivalent to [`strings.SplitN`](../strings/#stringssplitn), except that regular expressions are supported. This function provides the same behaviour as Go's - [`regexp.Split`](https://golang.org/pkg/regexp/#Regexp.Split) function. + [`regexp.Split`](https://pkg.go.dev/regexp/#Regexp.Split) function. pipeline: true arguments: - name: expression diff --git a/docs-src/content/functions/sockaddr.yml b/docs-src/content/functions/sockaddr.yml index 9b3239b84..36399cfdd 100644 --- a/docs-src/content/functions/sockaddr.yml +++ b/docs-src/content/functions/sockaddr.yml @@ -155,7 +155,7 @@ funcs: Returns an array of `IfAddr`s filtered by interfaces that match the given selector's value. - This is the inverse of `sockaddr.Exclude`. See [`sockaddr.Exclude`](#sockaddr.Exclude) for details. + This is the inverse of `sockaddr.Exclude`. See [`sockaddr.Exclude`](#sockaddrexclude) for details. pipeline: true arguments: - name: selector diff --git a/docs-src/content/functions/strings.yml b/docs-src/content/functions/strings.yml index 2f874ac20..07378fb0b 100644 --- a/docs-src/content/functions/strings.yml +++ b/docs-src/content/functions/strings.yml @@ -6,7 +6,7 @@ funcs: description: | Abbreviates a string using `...` (ellipses). Takes an optional offset from the beginning of the string, and a maximum final width (including added ellipses). - _Also see [`strings.Trunc`](#strings-trunc)._ + _Also see [`strings.Trunc`](#stringstrunc)._ pipeline: true arguments: - name: offset @@ -133,7 +133,7 @@ funcs: ``` - name: strings.Sort released: v2.7.0 - deprecated: Use [`coll.Sort`](../coll/#coll-sort) instead + deprecated: Use [`coll.Sort`](../coll/#collsort) instead description: | Returns an alphanumerically-sorted copy of a given string list. pipeline: true @@ -172,7 +172,7 @@ funcs: - name: strings.Split released: v1.9.0 description: | - _Not to be confused with [`split`](#split), which is deprecated._ + _Not to be confused with [`split`](#split-_deprecated_), which is deprecated._ Slices `input` into the substrings separated by `separator`, returning a slice of the substrings between those separators. If `input` does not @@ -183,7 +183,7 @@ funcs: both inputs are empty (i.e. `strings.Split "" ""`), it will return an empty slice. - This is equivalent to [`strings.SplitN`](#strings-splitn) with a `count` + This is equivalent to [`strings.SplitN`](#stringssplitn) with a `count` of `-1`. Note that the delimiter is not included in the resulting elements. @@ -210,7 +210,7 @@ funcs: - name: strings.SplitN released: v1.9.0 description: | - _Not to be confused with [`splitN`](#splitn), which is deprecated._ + _Not to be confused with [`splitN`](#splitn-_deprecated_), which is deprecated._ Slices `input` into the substrings separated by `separator`, returning a slice of the substrings between those separators. If `input` does not @@ -224,7 +224,7 @@ funcs: * `count == 0`: the result is nil (zero substrings) * `count < 0`: all substrings - See [`strings.Split`](#strings-split) for more details. + See [`strings.Split`](#stringssplit) for more details. pipeline: true arguments: - name: separator @@ -273,7 +273,7 @@ funcs: It errors if `count` is negative or if the length of `input` multiplied by `count` overflows. - This wraps Go's [`strings.Repeat`](https://golang.org/pkg/strings/#Repeat). + This wraps Go's [`strings.Repeat`](https://pkg.go.dev/strings/#Repeat). pipeline: true arguments: - name: count @@ -426,7 +426,7 @@ funcs: description: | Returns a string without the provided leading prefix string, if the prefix is present. - This wraps Go's [`strings.TrimPrefix`](https://golang.org/pkg/strings/#TrimPrefix). + This wraps Go's [`strings.TrimPrefix`](https://pkg.go.dev/strings/#TrimPrefix). pipeline: true arguments: - name: prefix @@ -459,7 +459,7 @@ funcs: description: | Returns a string without the provided trailing suffix string, if the suffix is present. - This wraps Go's [`strings.TrimSuffix`](https://golang.org/pkg/strings/#TrimSuffix). + This wraps Go's [`strings.TrimSuffix`](https://pkg.go.dev/strings/#TrimSuffix). pipeline: true arguments: - name: suffix @@ -477,7 +477,7 @@ funcs: description: | Returns a string truncated to the given length. - _Also see [`strings.Abbrev`](#strings-abbrev)._ + _Also see [`strings.Abbrev`](#stringsabbrev)._ pipeline: true arguments: - name: length @@ -594,7 +594,7 @@ funcs: Inputs will first be converted to strings, and multiple inputs are concatenated. - This wraps Go's [`utf8.RuneCountInString`](https://golang.org/pkg/unicode/utf8/#RuneCountInString) + This wraps Go's [`utf8.RuneCountInString`](https://pkg.go.dev/unicode/utf8/#RuneCountInString) function. pipeline: true arguments: @@ -608,13 +608,13 @@ funcs: 0 is 1 bytes and 1 runes ᐰ is 3 bytes and 1 runes - name: contains - deprecated: Use [`strings.Contains`](#strings-contains) instead + deprecated: Use [`strings.Contains`](#stringscontains) instead released: v1.4.0 description: | - **See [`strings.Contains`](#strings-contains) for a pipeline-compatible version** + **See [`strings.Contains`](#stringscontains) for a pipeline-compatible version** Contains reports whether the second string is contained within the first. Equivalent to - [strings.Contains](https://golang.org/pkg/strings#Contains) + [strings.Contains](https://pkg.go.dev/strings#Contains) pipeline: false arguments: - name: input @@ -637,13 +637,13 @@ funcs: no ``` - name: hasPrefix - deprecated: Use [`strings.HasPrefix`](#strings-hasprefix) instead + deprecated: Use [`strings.HasPrefix`](#stringshasprefix) instead released: v1.4.0 description: | - **See [`strings.HasPrefix`](#strings-hasprefix) for a pipeline-compatible version** + **See [`strings.HasPrefix`](#stringshasprefix) for a pipeline-compatible version** Tests whether the string begins with a certain substring. Equivalent to - [strings.HasPrefix](https://golang.org/pkg/strings#HasPrefix) + [strings.HasPrefix](https://pkg.go.dev/strings#HasPrefix) pipeline: false arguments: - name: input @@ -666,13 +666,13 @@ funcs: foo ``` - name: hasSuffix - deprecated: Use [`strings.HasSuffix`](#strings-hassuffix) instead + deprecated: Use [`strings.HasSuffix`](#stringshassuffix) instead released: v1.4.0 description: | - **See [`strings.HasSuffix`](#strings-hassuffix) for a pipeline-compatible version** + **See [`strings.HasSuffix`](#stringshassuffix) for a pipeline-compatible version** Tests whether the string ends with a certain substring. Equivalent to - [strings.HasSuffix](https://golang.org/pkg/strings#HasSuffix) + [strings.HasSuffix](https://pkg.go.dev/strings#HasSuffix) pipeline: false arguments: - name: input @@ -693,13 +693,13 @@ funcs: http://example.com:80 ``` - name: split - deprecated: Use [`strings.Split`](#strings-split) instead + deprecated: Use [`strings.Split`](#stringssplit) instead released: v1.4.0 description: | - **See [`strings.Split`](#strings-split) for a pipeline-compatible version** + **See [`strings.Split`](#stringssplit) for a pipeline-compatible version** Creates a slice by splitting a string on a given delimiter. Equivalent to - [strings.Split](https://golang.org/pkg/strings#Split) + [strings.Split](https://pkg.go.dev/strings#Split) pipeline: false arguments: - name: input @@ -716,13 +716,13 @@ funcs: Hello, Lisa Hello, Maggie - name: splitN - deprecated: Use [`strings.SplitN`](#strings-splitn) instead + deprecated: Use [`strings.SplitN`](#stringssplitn) instead released: v1.7.0 description: | - **See [`strings.SplitN`](#strings-splitn) for a pipeline-compatible version** + **See [`strings.SplitN`](#stringssplitn) for a pipeline-compatible version** Creates a slice by splitting a string on a given delimiter. The count determines - the number of substrings to return. Equivalent to [strings.SplitN](https://golang.org/pkg/strings#SplitN) + the number of substrings to return. Equivalent to [strings.SplitN](https://pkg.go.dev/strings#SplitN) pipeline: false arguments: - name: input @@ -741,13 +741,13 @@ funcs: foo bar:baz - name: trim - deprecated: Use [`strings.Trim`](#strings-trim) instead + deprecated: Use [`strings.Trim`](#stringstrim) instead released: v1.4.0 description: | - **See [`strings.Trim`](#strings-trim) for a pipeline-compatible version** + **See [`strings.Trim`](#stringstrim) for a pipeline-compatible version** Trims a string by removing the given characters from the beginning and end of - the string. Equivalent to [strings.Trim](https://golang.org/pkg/strings/#Trim) + the string. Equivalent to [strings.Trim](https://pkg.go.dev/strings/#Trim) pipeline: false arguments: - name: input diff --git a/docs-src/content/functions/test.yml b/docs-src/content/functions/test.yml index 09bd1b029..7d312e26a 100644 --- a/docs-src/content/functions/test.yml +++ b/docs-src/content/functions/test.yml @@ -61,7 +61,7 @@ funcs: represent _any_ numeric kind (whether `float32`, `uint8`, or whatever). This is useful when the specific numeric type is unknown. - See also [`test.Kind`](test-kind). + See also [`test.Kind`](#testkind). pipeline: true arguments: - name: kind @@ -99,7 +99,7 @@ funcs: If you need to know the precise type of a value, use `printf "%T" $value`. - See also [`test.IsKind`](test-iskind). + See also [`test.IsKind`](#testiskind). pipeline: true arguments: - name: value @@ -156,7 +156,7 @@ funcs: alias: ternary released: v3.1.0 description: | - Returns one of two values depending on whether the third is true. Note that the third value does not have to be a boolean - it is converted first by the [`conv.ToBool`](../conv/#conv-tobool) function (values like `true`, `1`, `"true"`, `"Yes"`, etc... are considered true). + Returns one of two values depending on whether the third is true. Note that the third value does not have to be a boolean - it is converted first by the [`conv.ToBool`](../conv/#convtobool) function (values like `true`, `1`, `"true"`, `"Yes"`, etc... are considered true). This is effectively a short-form of the following template: diff --git a/docs-src/content/functions/time.yml b/docs-src/content/functions/time.yml index bc7b1e32b..ddef213ed 100644 --- a/docs-src/content/functions/time.yml +++ b/docs-src/content/functions/time.yml @@ -1,8 +1,8 @@ ns: time preamble: | - This namespace wraps Go's [`time` package](https://golang.org/pkg/time/), and a + This namespace wraps Go's [`time` package](https://pkg.go.dev/time/), and a few of the functions return a `time.Time` value. All of the - [`time.Time` functions](https://golang.org/pkg/time/#Time) can then be used to + [`time.Time` functions](https://pkg.go.dev/time/#Time) can then be used to convert, adjust, or format the time in your template. ### Reference time @@ -46,9 +46,9 @@ preamble: | #### durations - Some operations (such as [`Time.Add`](https://golang.org/pkg/time/#Time.Add) and - [`Time.Round`](https://golang.org/pkg/time/#Time.Round)) require a - [`Duration`](https://golang.org/pkg/time/#Duration) value. These can be created + Some operations (such as [`Time.Add`](https://pkg.go.dev/time/#Time.Add) and + [`Time.Round`](https://pkg.go.dev/time/#Time.Round)) require a + [`Duration`](https://pkg.go.dev/time/#Duration) value. These can be created conveniently with the following functions: - `time.Nanosecond` @@ -67,24 +67,24 @@ preamble: | 11:05AM ``` - For other durations, such as `2h10m`, [`time.ParseDuration`](#time-parseduration) can be used. + For other durations, such as `2h10m`, [`time.ParseDuration`](#timeparseduration) can be used. funcs: - name: time.Now released: v2.1.0 description: | - Returns the current local time, as a `time.Time`. This wraps [`time.Now`](https://golang.org/pkg/time/#Now). + Returns the current local time, as a `time.Time`. This wraps [`time.Now`](https://pkg.go.dev/time/#Now). Usually, further functions are called using the value returned by `Now`. pipeline: false rawExamples: - | - Usage with [`UTC`](https://golang.org/pkg/time/#Time.UTC) and [`Format`](https://golang.org/pkg/time/#Time.Format): + Usage with [`UTC`](https://pkg.go.dev/time/#Time.UTC) and [`Format`](https://pkg.go.dev/time/#Time.Format): ```console $ gomplate -i '{{ (time.Now).UTC.Format "Day 2 of month 1 in year 2006 (timezone MST)" }}' Day 14 of month 10 in year 2017 (timezone UTC) ``` - | - Usage with [`AddDate`](https://golang.org/pkg/time/#Time.AddDate): + Usage with [`AddDate`](https://pkg.go.dev/time/#Time.AddDate): ```console $ date Sat Oct 14 09:57:02 EDT 2017 @@ -94,7 +94,7 @@ funcs: _(notice how the TZ adjusted for daylight savings!)_ - | - Usage with [`IsDST`](https://golang.org/pkg/time/#Time.IsDST): + Usage with [`IsDST`](https://pkg.go.dev/time/#Time.IsDST): ```console $ gomplate -i '{{ $t := time.Now }}At the tone, the time will be {{ ($t.Round (time.Minute 1)).Add (time.Minute 1) }}. It is{{ if not $t.IsDST }} not{{ end }} daylight savings time. @@ -106,12 +106,12 @@ funcs: - name: time.Parse released: v2.1.0 description: | - Parses a timestamp defined by the given layout. This wraps [`time.Parse`](https://golang.org/pkg/time/#Parse). + Parses a timestamp defined by the given layout. This wraps [`time.Parse`](https://pkg.go.dev/time/#Parse). A number of pre-defined layouts are provided as constants, defined - [here](https://golang.org/pkg/time/#pkg-constants). + [here](https://pkg.go.dev/time/#pkg-constants). - Just like [`time.Now`](#time-now), this is usually used in conjunction with + Just like [`time.Now`](#timenow), this is usually used in conjunction with other functions. _Note: In the absence of a time zone indicator, `time.Parse` returns a time in UTC._ @@ -125,7 +125,7 @@ funcs: description: The timestamp to parse rawExamples: - | - Usage with [`Format`](https://golang.org/pkg/time/#Time.Format): + Usage with [`Format`](https://pkg.go.dev/time/#Time.Format): ```console $ gomplate -i '{{ (time.Parse "2006-01-02" "1993-10-23").Format "Monday January 2, 2006 MST" }}' Saturday October 23, 1993 UTC @@ -133,7 +133,7 @@ funcs: - name: time.ParseDuration released: v2.1.0 description: | - Parses a duration string. This wraps [`time.ParseDuration`](https://golang.org/pkg/time/#ParseDuration). + Parses a duration string. This wraps [`time.ParseDuration`](https://pkg.go.dev/time/#ParseDuration). A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as `300ms`, `-1.5h` or `2h45m`. Valid @@ -152,7 +152,7 @@ funcs: - name: time.ParseLocal released: v2.2.0 description: | - Same as [`time.Parse`](#time-parse), except that in the absence of a time zone + Same as [`time.Parse`](#timeparse), except that in the absence of a time zone indicator, the timestamp wil be parsed in the local timezone. pipeline: true arguments: @@ -164,7 +164,7 @@ funcs: description: The timestamp to parse rawExamples: - | - Usage with [`Format`](https://golang.org/pkg/time/#Time.Format): + Usage with [`Format`](https://pkg.go.dev/time/#Time.Format): ```console $ bin/gomplate -i '{{ (time.ParseLocal time.Kitchen "6:00AM").Format "15:04 MST" }}' 06:00 EST @@ -172,9 +172,9 @@ funcs: - name: time.ParseInLocation released: v2.2.0 description: | - Same as [`time.Parse`](#time-parse), except that the time is parsed in the given location's time zone. + Same as [`time.Parse`](#timeparse), except that the time is parsed in the given location's time zone. - This wraps [`time.ParseInLocation`](https://golang.org/pkg/time/#ParseInLocation). + This wraps [`time.ParseInLocation`](https://pkg.go.dev/time/#ParseInLocation). pipeline: true arguments: - name: layout @@ -188,7 +188,7 @@ funcs: description: The timestamp to parse rawExamples: - | - Usage with [`Format`](https://golang.org/pkg/time/#Time.Format): + Usage with [`Format`](https://pkg.go.dev/time/#Time.Format): ```console $ gomplate -i '{{ (time.ParseInLocation time.Kitchen "Africa/Luanda" "6:00AM").Format "15:04 MST" }}' 06:00 LMT @@ -196,7 +196,7 @@ funcs: - name: time.Since released: v2.5.0 description: | - Returns the time elapsed since a given time. This wraps [`time.Since`](https://golang.org/pkg/time/#Since). + Returns the time elapsed since a given time. This wraps [`time.Since`](https://pkg.go.dev/time/#Since). It is shorthand for `time.Now.Sub t`. pipeline: true @@ -235,7 +235,7 @@ funcs: - name: time.Until released: v2.5.0 description: | - Returns the duration until a given time. This wraps [`time.Until`](https://golang.org/pkg/time/#Until). + Returns the duration until a given time. This wraps [`time.Until`](https://pkg.go.dev/time/#Until). It is shorthand for `$t.Sub time.Now`. pipeline: true diff --git a/docs-src/content/functions/tmpl.yml b/docs-src/content/functions/tmpl.yml index 54791dc64..5b4e36838 100644 --- a/docs-src/content/functions/tmpl.yml +++ b/docs-src/content/functions/tmpl.yml @@ -6,7 +6,7 @@ funcs: - name: tmpl.Exec released: v3.3.0 description: | - Execute (render) the named template. This is equivalent to using the [`template`](https://golang.org/pkg/text/template/#hdr-Actions) action, except the result is returned as a string. + Execute (render) the named template. This is equivalent to using the [`template`](https://pkg.go.dev/text/template/#hdr-Actions) action, except the result is returned as a string. This allows for post-processing of templates. pipeline: true diff --git a/docs-src/content/functions/uuid.yml b/docs-src/content/functions/uuid.yml index 09c8d48d7..ddd9951aa 100644 --- a/docs-src/content/functions/uuid.yml +++ b/docs-src/content/functions/uuid.yml @@ -18,7 +18,7 @@ funcs: description: | Create a version 1 UUID (based on the current MAC address and the current date/time). - Use [`uuid.V4`](#uuid-v4) instead in most cases. + Use [`uuid.V4`](#uuidv4) instead in most cases. pipeline: false examples: - | diff --git a/docs/content/config.md b/docs/content/config.md index a0eaf4858..00e2edbac 100644 --- a/docs/content/config.md +++ b/docs/content/config.md @@ -13,7 +13,7 @@ where teams share templates, it can be helpful to commit config files into the team's source control system. By default, gomplate will look for a file `.gomplate.yaml` in the current working -diretory, but this path can be altered with the [`--config`](../usage/#config) +directory, but this path can be altered with the [`--config`](../usage/#--config) command-line argument, or the `GOMPLATE_CONFIG` environment variable. ### Configuration precedence @@ -66,13 +66,13 @@ plugins: ## `chmod` -See [`--chmod`](../usage/#chmod). +See [`--chmod`](../usage/#--chmod). Sets the output file mode. ## `context` -See [`--context`](../usage/#context-c). +See [`--context`](../usage/#--context-c). Add data sources to the default context. This is a nested structure that includes the URL for the data source and the optional HTTP header to send. @@ -102,7 +102,7 @@ context: ## `datasources` -See [`--datasource`](../usage/#datasource-d). +See [`--datasource`](../usage/#--datasource-d). Define data sources. This is a nested structure that includes the URL for the data source and the optional HTTP header to send. @@ -124,7 +124,7 @@ source is used, an `Authorization` header will be sent with the given value. ## `excludes` -See [`--exclude` and `--include`](../usage/#exclude-and-include). +See [`--exclude` and `--include`](../usage/#--exclude-and---include). This is an array of exclude patterns, used in conjunction with [`inputDir`](#inputdir). Note that there is no `includes`, instead you can specify negative @@ -141,7 +141,7 @@ This will skip all files with the extension `.txt`, except for files named ## `excludeProcessing` -See [`--exclude-processing`](../usage/#exclude-processing). +See [`--exclude-processing`](../usage/#--exclude-processing). This is an array of exclude patterns, used in conjunction with [`inputDir`](#inputdir). The matching files will be copied to the output directory without template rendering. @@ -155,7 +155,7 @@ This will copy all files with the extension `.jpg` to the output directory. ## `execPipe` -See [`--exec-pipe`](../usage/#exec-pipe). +See [`--exec-pipe`](../usage/#--exec-pipe). Use the rendered output as the [`postExec`](#postexec) command's standard input. @@ -164,7 +164,7 @@ any [`outputFiles`](#outputfiles) settings. ## `experimental` -See [`--experimental`](../usage/#experimental). Can also be set with the `GOMPLATE_EXPERIMENTAL=true` environment variable. +See [`--experimental`](../usage/#--experimental). Can also be set with the `GOMPLATE_EXPERIMENTAL=true` environment variable. Some functions and features are provided for early feedback behind the `experimental` configuration option. These features may change before being permanently enabled, and [feedback](https://github.com/hairyhenderson/gomplate/issues/new) is requested from early adopters! @@ -176,7 +176,7 @@ experimental: true ## `in` -See [`--in`/`-i`](../usage/#file-f-in-i-and-out-o). +See [`--in`/`-i`](../usage/#--file-f---in-i-and---out-o). Provide the input template inline. Note that unlike the `--in`/`-i` commandline argument, there are no shell-imposed length limits. @@ -202,7 +202,7 @@ May not be used with `inputDir` or `inputFiles`. ## `inputDir` -See [`--input-dir`](../usage/#input-dir-and-output-dir). +See [`--input-dir`](../usage/#--input-dir-and---output-dir). The directory containing input template files. All files contained within will be processed recursively. Must be used with [`outputDir`](#outputdir) or @@ -217,7 +217,7 @@ May not be used with `in` or `inputFiles`. ## `inputFiles` -See [`--file`/`-f`](../usage/#file-f-in-i-and-out-o). +See [`--file`/`-f`](../usage/#--file-f---in-i-and---out-o). An array of input template paths. The special value `-` means `Stdin`. Multiple values can be set, but there must be a corresponding number of `outputFiles` @@ -263,7 +263,7 @@ missingKey: error ## `outputDir` -See [`--output-dir`](../usage/#input-dir-and-output-dir). +See [`--output-dir`](../usage/#--input-dir-and---output-dir). The directory to write rendered output files. Must be used with [`inputDir`](#inputdir). @@ -280,7 +280,7 @@ May not be used with `outputFiles`. ## `outputFiles` -See [`--out`/`-o`](../usage/#file-f-in-i-and-out-o). +See [`--out`/`-o`](../usage/#--file-f---in-i-and---out-o). An array of output file paths. The special value `-` means `Stdout`. Multiple values can be set, but there must be a corresponding number of `inputFiles` @@ -311,7 +311,7 @@ May not be used with `inputDir`. ## `outputMap` -See [`--output-map`](../usage/#output-map). +See [`--output-map`](../usage/#--output-map). Must be used with [`inputDir`](#inputdir). @@ -323,7 +323,7 @@ outputMap: | ## `plugins` -See [`--plugin`](../usage/#plugin). +See [`--plugin`](../usage/#--plugin). A map that configures custom functions for use in the templates. The key is the name of the function, and the value configures the plugin. The value is a map @@ -417,7 +417,7 @@ The default is `5s`. ## `pluginTimeout` -See [`--plugin`](../usage/#plugin). +See [`--plugin`](../usage/#--plugin). Sets the timeout for all configured plugins. Overrides the default of `5s`. After this time, plugin commands will be killed. The value must be a valid @@ -449,7 +449,7 @@ rightDelim: '))' ## `templates` -See [`--template`/`-t`](../usage/#template-t). +See [`--template`/`-t`](../usage/#--template-t). ```yaml templates: @@ -464,4 +464,4 @@ templates: [command-line arguments]: ../usage [file an issue]: https://github.com/hairyhenderson/gomplate/issues/new [YAML]: http://yaml.org -[duration]: (../functions/time/#time-parseduration) +[duration]: ../functions/time/#timeparseduration diff --git a/docs/content/datasources.md b/docs/content/datasources.md index b07812f0f..e85ece521 100644 --- a/docs/content/datasources.md +++ b/docs/content/datasources.md @@ -35,7 +35,7 @@ For our purposes, the _scheme_ and the _path_ components are especially importan ### Opaque URIs -For some datasources, such as the [`merge`](#using-merge-datasources), [`aws+sm`](#using-aws-sm-datasources), and [`aws+smp`](#using-aws-smp-datasources) schemes, opaque URIs can be used (rather than a hierarchical URL): +For some datasources, such as the [`merge`](#using-merge-datasources), [`aws+sm`](#using-awssm-datasources), and [`aws+smp`](#using-awssmp-datasources) schemes, opaque URIs can be used (rather than a hierarchical URL): ```pre scheme path query fragment @@ -55,8 +55,8 @@ Gomplate supports a number of datasources, each specified with a particular URL | Type | URL Scheme(s) | Description | |------|---------------|-------------| -| [AWS Systems Manager Parameter Store](#using-aws-smp-datasources) | `aws+smp` | [AWS Systems Manager Parameter Store][AWS SMP] is a hierarchically-organized key/value store which allows storage of text, lists, or encrypted secrets for retrieval by AWS resources | -| [AWS Secrets Manager](#using-aws-sm-datasource) | `aws+sm` | [AWS Secrets Manager][] helps you protect secrets needed to access your applications, services, and IT resources. | +| [AWS Systems Manager Parameter Store](#using-awssmp-datasources) | `aws+smp` | [AWS Systems Manager Parameter Store][AWS SMP] is a hierarchically-organized key/value store which allows storage of text, lists, or encrypted secrets for retrieval by AWS resources | +| [AWS Secrets Manager](#using-awssm-datasources) | `aws+sm` | [AWS Secrets Manager][] helps you protect secrets needed to access your applications, services, and IT resources. | | [Amazon S3](#using-s3-datasources) | `s3` | [Amazon S3][] is a popular object storage service. | | [Consul](#using-consul-datasources) | `consul`, `consul+http`, `consul+https` | [HashiCorp Consul][] provides (among many other features) a key/value store | | [Environment](#using-env-datasources) | `env` | Environment variables can be used as datasources - useful for testing | @@ -75,13 +75,13 @@ When the _path_ component of the URL ends with a `/` character, the datasource i Currently the following datasources support directory semantics: - [File](#using-file-datasources) -- [Vault](#using-vault-datasources) - translates to Vault's [LIST](https://www.vaultproject.io/api/index.html#reading-writing-and-listing-secrets) method +- [Vault](#using-vault-datasources) - translates to Vault's `LIST` method - [Consul](#using-consul-datasources) When accessing a directory datasource, an array of key names is returned, and can be iterated through to access each individual value contained within. - [AWS S3](#using-s3-datasources) - [Google Cloud Storage](#using-google-cloud-storage-gs-datasources) - [Git](#using-git-datasources) -- [AWS Systems Manager Parameter Store](#using-aws-smp-datasources) +- [AWS Systems Manager Parameter Store](#using-awssmp-datasources) For example, a group of configuration key/value pairs (named `one`, `two`, and `three`, with values `v1`, `v2`, and `v3` respectively) could be rendered like this: @@ -158,7 +158,7 @@ The [`github.com/joho/godotenv`](https://github.com/joho/godotenv) package is us ## Using `aws+smp` datasources -The `aws+smp://` scheme can be used to retrieve data from the [AWS Systems Manager](https://aws.amazon.com/systems-manager/) (née AWS EC2 Simple Systems Manager) [Parameter Store](https://aws.amazon.com/systems-manager/features/#Parameter_Store). This hierarchically organized key/value store allows you to store text, lists or encrypted secrets for easy retrieval by AWS resources. See [the AWS Systems Manager documentation](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-su-create.html#sysman-paramstore-su-create-about) for details on creating these parameters. +The `aws+smp://` scheme can be used to retrieve data from the [AWS Systems Manager](https://aws.amazon.com/systems-manager/) (née AWS EC2 Simple Systems Manager) [Parameter Store][AWS SMP]. This hierarchically organized key/value store allows you to store text, lists or encrypted secrets for easy retrieval by AWS resources. See [the AWS Systems Manager documentation](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-su-create.html#sysman-paramstore-su-create-about) for details on creating these parameters. You must grant `gomplate` permission via IAM credentials for the [`ssm:GetParameter` action](https://docs.aws.amazon.com/systems-manager/latest/userguide/auth-and-access-control-permissions-reference.html). @@ -187,7 +187,7 @@ If the Parameter key specified is not found (or not allowed to be read due to mi ### Examples -Given your [AWS account's Parameter Store](https://eu-west-1.console.aws.amazon.com/ec2/v2/home#Parameters:sort=Name) has the following data: +Given your AWS account's Parameter Store has the following data: - `/foo/first/others` - `Bill,Ben` (a StringList) - `/foo/first/password` - `super-secret` (a SecureString) @@ -217,7 +217,7 @@ $ gomplate -d foo=aws+smp:myparameter -i '{{ (ds "foo").Value }} bar ``` -## Using `aws+sm` datasource +## Using `aws+sm` datasources ### URL Considerations @@ -228,11 +228,11 @@ For `aws+sm`, only the _scheme_ and _path_ components are necessary to be define ### Output -The output will be the content of either the `SecretString` or `SecretBinary` field of the AWS SDK's `GetSecretValueOutput` object from the [AWS SDK for Go](https://docs.aws.amazon.com/sdk-for-go/api/service/secretsmanager/#GetSecretValueOutput) +The output will be the content of either the `SecretString` or `SecretBinary` field of the AWS SDK's `GetSecretValueOutput` object from the [AWS SDK for Go](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/secretsmanager#GetSecretValueOutput) ### Examples -Given your [AWS account's Secret Manager](https://eu-central-1.console.aws.amazon.com/secretsmanager/home?region=eu-central-1#/listSecrets) has the following data: +Given your AWS account's Secret Manager has the following data: - `/foo/bar/password` - `super-secret` - `mysecret` - `bar` @@ -317,7 +317,7 @@ Hello world ## Using `consul` datasources -Gomplate supports retrieving data from [HashiCorp Consul][]'s [KV Store](https://www.consul.io/api/kv.html). +Gomplate supports retrieving data from [HashiCorp Consul][]'s [KV Store](https://developer.hashicorp.com/consul/api-docs/kv). ### URL Considerations @@ -337,23 +337,23 @@ The following optional environment variables are understood by the Consul dataso | `CONSUL_TIMEOUT` | Timeout (in seconds) when communicating to Consul. Defaults to 10 seconds. | | `CONSUL_HTTP_TOKEN` | The Consul token to use when connecting to the server. | | `CONSUL_HTTP_AUTH` | Should be specified as `:`. Used to authenticate to the server. | -| `CONSUL_HTTP_SSL` | Force HTTPS if set to `true` value. Disables if set to `false`. Any value acceptable to [`strconv.ParseBool`](https://golang.org/pkg/strconv/#ParseBool) can be provided. | +| `CONSUL_HTTP_SSL` | Force HTTPS if set to `true` value. Disables if set to `false`. Any value acceptable to [`strconv.ParseBool`](https://pkg.go.dev/strconv/#ParseBool) can be provided. | | `CONSUL_TLS_SERVER_NAME` | The server name to use as the SNI host when connecting to Consul via TLS. | | `CONSUL_CACERT` | Path to CA file for verifying Consul server using TLS. | | `CONSUL_CAPATH` | Path to directory of CA files for verifying Consul server using TLS. | | `CONSUL_CLIENT_CERT` | Client certificate file for certificate authentication. If this is set, `$CONSUL_CLIENT_KEY` must also be set. | | `CONSUL_CLIENT_KEY` | Client key file for certificate authentication. If this is set, `$CONSUL_CLIENT_CERT` must also be set. | -| `CONSUL_HTTP_SSL_VERIFY` | Set to `false` to disable Consul TLS certificate checking. Any value acceptable to [`strconv.ParseBool`](https://golang.org/pkg/strconv/#ParseBool) can be provided.
_Recommended only for testing and development scenarios!_ | -| `CONSUL_VAULT_ROLE` | Set to the name of the role to use for authenticating to Consul with [Vault's Consul secret backend](https://www.vaultproject.io/docs/secrets/consul/index.html). | +| `CONSUL_HTTP_SSL_VERIFY` | Set to `false` to disable Consul TLS certificate checking. Any value acceptable to [`strconv.ParseBool`](https://pkg.go.dev/strconv/#ParseBool) can be provided.
_Recommended only for testing and development scenarios!_ | +| `CONSUL_VAULT_ROLE` | Set to the name of the role to use for authenticating to Consul with [Vault's Consul secret backend](https://developer.hashicorp.com/vault/docs/secrets/consul). | | `CONSUL_VAULT_MOUNT` | Used to override the mount-point when using Vault's Consul secret back-end for authentication. Defaults to `consul`. | ### Authentication Instead of using a non-authenticated Consul connection, you can authenticate with these methods: -- provide an [ACL Token](https://www.consul.io/docs/guides/acl.html#acl-tokens) in the `CONSUL_HTTP_TOKEN` environment variable +- provide an [ACL Token](https://developer.hashicorp.com/consul/docs/security/acl#tokens) in the `CONSUL_HTTP_TOKEN` environment variable - use HTTP Basic Auth by setting the `CONSUL_HTTP_AUTH` environment variable -- dynamically generate an ACL token with Vault. This requires Vault to be configured to use the [Consul secret backend](https://www.vaultproject.io/docs/secrets/consul/index.html) and is enabled by passing the name of the role to use in the `CONSUL_VAULT_ROLE` environment variable. +- dynamically generate an ACL token with Vault. This requires Vault to be configured to use the [Consul secret backend](https://developer.hashicorp.com/vault/docs/secrets/consul) and is enabled by passing the name of the role to use in the `CONSUL_VAULT_ROLE` environment variable. ### Examples @@ -654,7 +654,7 @@ Gomplate can retrieve secrets and other data from [HashiCorp Vault][]. The _scheme_, _authority_, _path_, and _query_ URL components are used by this datasource. -- the _scheme_ must be one of `vault`, `vault+https` (same as `vault`), or `vault+http`. The latter can be used to access [dev mode](https://www.vaultproject.io/docs/concepts/dev-server.html) Vault servers, for test purposes. Otherwise, all connections to Vault are encrypted with TLS. +- the _scheme_ must be one of `vault`, `vault+https` (same as `vault`), or `vault+http`. The latter can be used to access [dev mode](https://developer.hashicorp.com/vault/docs/concepts/dev-server) Vault servers, for test purposes. Otherwise, all connections to Vault are encrypted with TLS. - the _authority_ component can optionally be used to specify the Vault server's hostname and port. This overrides the value of `$VAULT_ADDR`. - the _path_ component can optionally be used to specify a full or partial path to a secret. The second argument to the [`datasource`][] function is appended to provide the full secret path. [Directory](#directory-datasources) semantics are available when the path ends with a `/` character. - the _query_ component is used to provide parameters to dynamic secret back-ends that require these. The values are included in the JSON body of the `POST` request. The `version` parameter in particular can be used to specify the version of a secret when using the KV v2 secrets engine. @@ -676,17 +676,17 @@ This table describes the currently-supported authentication mechanisms and how t | auth back-end | configuration | |-------------:|---------------| -| [`approle`](https://www.vaultproject.io/docs/auth/approle.html) | Environment variables `$VAULT_ROLE_ID` and `$VAULT_SECRET_ID` must be set to the appropriate values.
If the back-end is mounted to a different location, set `$VAULT_AUTH_APPROLE_MOUNT`. | -| [`github`](https://www.vaultproject.io/docs/auth/github.html) | Environment variable `$VAULT_AUTH_GITHUB_TOKEN` must be set to an appropriate value.
If the back-end is mounted to a different location, set `$VAULT_AUTH_GITHUB_MOUNT`. | -| [`userpass`](https://www.vaultproject.io/docs/auth/userpass.html) | Environment variables `$VAULT_AUTH_USERNAME` and `$VAULT_AUTH_PASSWORD` must be set to the appropriate values.
If the back-end is mounted to a different location, set `$VAULT_AUTH_USERPASS_MOUNT`. | -| [`token`](https://www.vaultproject.io/docs/auth/token.html) | Determined from either the `$VAULT_TOKEN` environment variable, or read from the file `~/.vault-token` | -| [`aws`](https://www.vaultproject.io/docs/auth/aws.html) | The env var `$VAULT_AUTH_AWS_ROLE` defines the [role](https://www.vaultproject.io/api/auth/aws/index.html#role-4) to log in with - defaults to the AMI ID of the EC2 instance. Usually a [Client Nonce](https://www.vaultproject.io/docs/auth/aws.html#client-nonce) should be used as well. Set `$VAULT_AUTH_AWS_NONCE` to the nonce value. The nonce can be generated and stored by setting `$VAULT_AUTH_AWS_NONCE_OUTPUT` to a path on the local filesystem.
If the back-end is mounted to a different location, set `$VAULT_AUTH_AWS_MOUNT`.| +| [`approle`](https://developer.hashicorp.com/vault/docs/auth/approle) | Environment variables `$VAULT_ROLE_ID` and `$VAULT_SECRET_ID` must be set to the appropriate values.
If the back-end is mounted to a different location, set `$VAULT_AUTH_APPROLE_MOUNT`. | +| [`github`](https://developer.hashicorp.com/vault/docs/auth/github) | Environment variable `$VAULT_AUTH_GITHUB_TOKEN` must be set to an appropriate value.
If the back-end is mounted to a different location, set `$VAULT_AUTH_GITHUB_MOUNT`. | +| [`userpass`](https://developer.hashicorp.com/vault/docs/auth/userpass) | Environment variables `$VAULT_AUTH_USERNAME` and `$VAULT_AUTH_PASSWORD` must be set to the appropriate values.
If the back-end is mounted to a different location, set `$VAULT_AUTH_USERPASS_MOUNT`. | +| [`token`](https://developer.hashicorp.com/vault/docs/auth/token) | Determined from either the `$VAULT_TOKEN` environment variable, or read from the file `~/.vault-token` | +| [`aws`](https://developer.hashicorp.com/vault/docs/auth/aws) | The env var `$VAULT_AUTH_AWS_ROLE` defines the [role](https://developer.hashicorp.com/vault/api-docs/auth/aws#role-4) to log in with - defaults to the AMI ID of the EC2 instance. Usually a [Client Nonce](https://developer.hashicorp.com/vault/docs/auth/aws#client-nonce) should be used as well. Set `$VAULT_AUTH_AWS_NONCE` to the nonce value. The nonce can be generated and stored by setting `$VAULT_AUTH_AWS_NONCE_OUTPUT` to a path on the local filesystem.
If the back-end is mounted to a different location, set `$VAULT_AUTH_AWS_MOUNT`.| _**Note:**_ The secret values listed in the above table can either be set in environment variables or provided in files. This can increase security when using [Docker Swarm Secrets](https://docs.docker.com/engine/swarm/secrets/), for example. To use files, specify the filename by appending `_FILE` to the environment variable, (i.e. `VAULT_USER_ID_FILE`). If the non-file variable is set, this will override any `_FILE` variable and the secret file will be ignored. ### Vault Permissions -The correct capabilities must be allowed for the [authenticated](#vault-authentication) credentials. See the [Vault documentation](https://www.vaultproject.io/docs/concepts/policies.html#capabilities) for full details. +The correct capabilities must be allowed for the [authenticated](#vault-authentication) credentials. See the [Vault documentation](https://developer.hashicorp.com/vault/docs/concepts/policies#capabilities) for full details. - regular secret read operations require the `read` capability - dynamic secret generation requires the `create` and `update` capabilities @@ -694,7 +694,7 @@ The correct capabilities must be allowed for the [authenticated](#vault-authenti ### Vault Environment variables -In addition to the variables documented [above](#vault-authentication), a number of environment variables are interpreted by the Vault client, and are documented in the [official Vault documentation](https://www.vaultproject.io/docs/commands/index.html#environment-variables). +In addition to the variables documented [above](#vault-authentication), a number of environment variables are interpreted by the Vault client, and are documented in the [official Vault documentation](https://developer.hashicorp.com/vault/docs/commands#environment-variables). ### Examples @@ -751,22 +751,22 @@ $ gomplate -d vault=vault:///secret/foo -i '{{ (ds "vault").value }}' The file `/tmp/vault-aws-nonce` will be created if it didn't already exist, and further executions of `gomplate` can re-authenticate securely. -[`--datasource`/`-d`]: ../usage/#datasource-d -[`--context`/`-c`]: ../usage/#context-c +[`--datasource`/`-d`]: ../usage/#--datasource-d +[`--context`/`-c`]: ../usage/#--context-c [context]: ../syntax/#the-context -[`--datasource-header`/`-H`]: ../usage/#datasource-header-h +[`--datasource-header`/`-H`]: ../usage/#--datasource-header-h [`defineDatasource`]: ../functions/data/#definedatasource [`datasource`]: ../functions/data/#datasource [`include`]: ../functions/data/#include -[`data.CSV`]: ../functions/data/#data-csv -[`data.JSON`]: ../functions/data/#data-json +[`data.CSV`]: ../functions/data/#datacsv +[`data.JSON`]: ../functions/data/#datajson [EJSON]: ../functions/data/#encrypted-json-support-ejson -[`data.JSONArray`]: ../functions/data/#data-jsonarray -[`data.TOML`]: ../functions/data/#data-toml -[`data.YAML`]: ../functions/data/#data-yaml -[`coll.Merge`]: ../functions/coll/#coll-merge +[`data.JSONArray`]: ../functions/data/#datajsonarray +[`data.TOML`]: ../functions/data/#datatoml +[`data.YAML`]: ../functions/data/#datayaml +[`coll.Merge`]: ../functions/coll/#collmerge -[AWS SMP]: https://aws.amazon.com/systems-manager/features#Parameter_Store +[AWS SMP]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html [AWS Secrets Manager]: https://aws.amazon.com/secrets-manager [HashiCorp Consul]: https://consul.io [HashiCorp Vault]: https://vaultproject.io diff --git a/docs/content/functions/_index.md b/docs/content/functions/_index.md index 8fd7a43fa..adb44e2bb 100644 --- a/docs/content/functions/_index.md +++ b/docs/content/functions/_index.md @@ -29,7 +29,7 @@ for full details: - `and`, `or`, `not`: Returns boolean AND/OR/NOT of the argument(s). - `call`: Returns the result of calling a function argument. - `html`, `js`, `urlquery`: Safely escapes input for inclusion in HTML, JavaScript, and URL query strings. -- `index`: Returns the referenced element of an array/slice, string, or map. See also [Arrays](#arrays) and [Maps](#maps). +- `index`: Returns the referenced element of an array/slice, string, or map. See also [Arrays](../syntax/#arrays) and [Maps](../syntax/#maps). - `len`: Returns the length of the argument. - `print`, `printf`, `println`: Aliases for Go's [`fmt.Print`](https://golang.org/pkg/fmt/#Print), [`fmt.Printf`](https://golang.org/pkg/fmt/#Printf), and [`fmt.Println`](https://golang.org/pkg/fmt/#Println) @@ -53,7 +53,7 @@ There are also a few _actions_, which are used for control flow and other purpos - `if`/`else`/`else if`: Conditional control flow. - `with`/`else`: Conditional execution with assignment. -- `range`: Looping control flow. See discussion in the [Arrays](#arrays) and [Maps](#maps) sections. +- `range`: Looping control flow. See discussion in the [Arrays](../syntax/#arrays) and [Maps](../syntax/#maps) sections. - `break`: The innermost `range` loop is ended early, stopping the current iteration and bypassing all remaining iterations. - `continue`: The current iteration of the innermost `range` loop is stopped, and the loop starts the next iteration. - `template`: Include the output of a named template. See the [Nested templates](/syntax/#nested-templates) section for more details, and the [`tmpl`](../functions/tmpl) namespace for more flexible versions of `template`. @@ -68,5 +68,5 @@ are grouped into namespaces, and documented on the following pages: {{% children depth="3" description="false" %}} [`text/template`]: https://golang.org/pkg/text/template/ -[`base64.Encode`]: ../functions/base64#base64-encode +[`base64.Encode`]: ../functions/base64#base64encode [data sources]: ../datasources/ diff --git a/docs/content/functions/aws.md b/docs/content/functions/aws.md index e066f5617..5ef363df1 100644 --- a/docs/content/functions/aws.md +++ b/docs/content/functions/aws.md @@ -28,7 +28,7 @@ for details. **Alias:** `ec2meta` -Queries AWS [EC2 Instance Metadata](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `meta-data` path -- for data in the `dynamic` path use `aws.EC2Dynamic`. +Queries AWS [EC2 Instance Metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `meta-data` path -- for data in the `dynamic` path use `aws.EC2Dynamic`. For times when running outside EC2, or when the metadata API can't be reached, a `default` value can be provided. @@ -57,7 +57,7 @@ i-12345678 **Alias:** `ec2dynamic` -Queries AWS [EC2 Instance Dynamic Metadata](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `dynamic` path -- for data in the `meta-data` path use `aws.EC2Meta`. +Queries AWS [EC2 Instance Dynamic Metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `dynamic` path -- for data in the `meta-data` path use `aws.EC2Meta`. For times when running outside EC2, or when the metadata API can't be reached, a `default` value can be provided. @@ -121,7 +121,7 @@ foo **Alias:** `ec2tag` -Queries the AWS EC2 API to find the value of the given [user-defined tag](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). An optional default +Queries the AWS EC2 API to find the value of the given [user-defined tag](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). An optional default can be provided. _Added in gomplate [v3.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.8.0)_ @@ -153,7 +153,7 @@ I am a meat popsicle. **Alias:** `ec2tags` -Queries the AWS EC2 API to find all the tags/values [user-defined tag](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). +Queries the AWS EC2 API to find all the tags/values [user-defined tag](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). _Added in gomplate [v3.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.8.0)_ ### Usage @@ -197,7 +197,7 @@ For information on creating keys, see [_Creating Keys_](https://docs.aws.amazon. See [the AWS documentation](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) for more details. -See also [`aws.KMSDecrypt`](#aws-kmsdecrypt). +See also [`aws.KMSDecrypt`](#awskmsdecrypt). _Added in gomplate [v4.0.0](https://github.com/hairyhenderson/gomplate/releases/tag/v4.0.0)_ ### Usage @@ -233,7 +233,7 @@ The ciphertext must be base-64 encoded. See [the AWS documentation](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) for more details. -See also [`aws.KMSEncrypt`](#aws-kmsencrypt). +See also [`aws.KMSEncrypt`](#awskmsencrypt). _Added in gomplate [v3.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.4.0)_ ### Usage @@ -264,7 +264,7 @@ Returns the currently-authenticated AWS account ID number. Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html) -See also [`aws.UserID`](#aws-userid) and [`aws.ARN`](#aws-arn). +See also [`aws.UserID`](#awsuserid) and [`aws.ARN`](#awsarn). _Added in gomplate [v3.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.4.0)_ ### Usage @@ -287,7 +287,7 @@ Returns the AWS ARN (Amazon Resource Name) associated with the current authentic Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html) -See also [`aws.UserID`](#aws-userid) and [`aws.Account`](#aws-account). +See also [`aws.UserID`](#awsuserid) and [`aws.Account`](#awsaccount). _Added in gomplate [v3.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.4.0)_ ### Usage @@ -308,12 +308,12 @@ Calling from arn:aws:iam::123456789012:user/Alice Returns the unique identifier of the calling entity. The exact value depends on the type of entity making the call. The values returned are those -listed in the `aws:userid` column in the [Principal table](http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) +listed in the `aws:userid` column in the [Principal table](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) found on the Policy Variables reference page in the IAM User Guide. Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html) -See also [`aws.ARN`](#aws-arn) and [`aws.Account`](#aws-account). +See also [`aws.ARN`](#awsarn) and [`aws.Account`](#awsaccount). _Added in gomplate [v3.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.4.0)_ ### Usage diff --git a/docs/content/functions/base64.md b/docs/content/functions/base64.md index 64d3fc8e1..a222e7e75 100644 --- a/docs/content/functions/base64.md +++ b/docs/content/functions/base64.md @@ -42,7 +42,7 @@ aGVsbG8gd29ybGQ= Decode a Base64 string. This supports both standard ([RFC4648 §4](https://tools.ietf.org/html/rfc4648#section-4)) and URL-safe ([RFC4648 §5](https://tools.ietf.org/html/rfc4648#section-5)) encodings. This function outputs the data as a string, so it may not be appropriate -for decoding binary data. Use [`base64.DecodeBytes`](#base64.DecodeBytes) +for decoding binary data. Use [`base64.DecodeBytes`](#base64decodebytes) for binary data. _Added in gomplate [v1.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.8.0)_ @@ -78,7 +78,7 @@ Decode a Base64 string. This supports both standard ([RFC4648 §4](https://t This function outputs the data as a byte array, so it's most useful for outputting binary data that will be processed further. -Use [`base64.Decode`](#base64.Decode) to output a plain string. +Use [`base64.Decode`](#base64decode) to output a plain string. _Added in gomplate [v3.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.8.0)_ ### Usage diff --git a/docs/content/functions/coll.md b/docs/content/functions/coll.md index 50164fe93..705ca6eb9 100644 --- a/docs/content/functions/coll.md +++ b/docs/content/functions/coll.md @@ -23,11 +23,11 @@ set as the value. All keys are converted to strings. This function is equivalent to [Sprig's `dict`](http://masterminds.github.io/sprig/dicts.html#dict) -function, as used in [Helm templates](https://docs.helm.sh/chart_template_guide#template-functions-and-pipelines). +function, as used in [Helm templates](https://helm.sh/docs/chart_template_guide/functions_and_pipelines/). -For creating more complex maps, see [`data.JSON`](../data/#data-json) or [`data.YAML`](../data/#data-yaml). +For creating more complex maps, see [`data.JSON`](../data/#datajson) or [`data.YAML`](../data/#datayaml). -For creating arrays, see [`coll.Slice`](#coll-slice). +For creating arrays, see [`coll.Slice`](#collslice-_deprecated_). _Added in gomplate [v3.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.2.0)_ ### Usage @@ -92,7 +92,7 @@ Hello, Maggie ## `coll.GoSlice` -This exposes the `slice` function from Go's [`text/template`](https://golang.org/pkg/text/template/#hdr-Functions) +This exposes the `slice` function from Go's [`text/template`](https://pkg.go.dev/text/template/#hdr-Functions) package. Note that using `slice` will use the `coll.Slice` function instead, which may not be desired. For some background on this, see [this issue](https://github.com/hairyhenderson/gomplate/issues/1461). @@ -300,7 +300,7 @@ Return a list of keys in one or more maps. The keys will be ordered first by map position (if multiple maps are given), then alphabetically. -See also [`coll.Values`](#coll-values). +See also [`coll.Values`](#collvalues). _Added in gomplate [v3.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.2.0)_ ### Usage @@ -336,7 +336,7 @@ Return a list of values in one or more maps. The values will be ordered first by map position (if multiple maps are given), then alphabetically by key. -See also [`coll.Keys`](#coll-keys). +See also [`coll.Keys`](#collkeys). _Added in gomplate [v3.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.2.0)_ ### Usage @@ -371,7 +371,7 @@ Append a value to the end of a list. _Note that this function does not change the given list; it always produces a new one._ -See also [`coll.Prepend`](#coll-prepend). +See also [`coll.Prepend`](#collprepend). _Added in gomplate [v3.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.2.0)_ ### Usage @@ -405,7 +405,7 @@ Prepend a value to the beginning of a list. _Note that this function does not change the given list; it always produces a new one._ -See also [`coll.Append`](#coll-append). +See also [`coll.Append`](#collappend). _Added in gomplate [v3.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.2.0)_ ### Usage @@ -631,7 +631,7 @@ Given a map, returns a new map with any entries that have the given keys. The keys can either be separate arguments, or a slice (since v4.0.0). -This is the inverse of [`coll.Omit`](#coll-omit). +This is the inverse of [`coll.Omit`](#collomit). _Note that this function does not modify the input._ @@ -672,7 +672,7 @@ Given a map, returns a new map without any entries that have the given keys. The keys can either be separate arguments, or a slice (since v4.0.0). -This is the inverse of [`coll.Pick`](#coll-pick). +This is the inverse of [`coll.Pick`](#collpick). _Note that this function does not modify the input._ diff --git a/docs/content/functions/conv.md b/docs/content/functions/conv.md index 904efb2f4..ae3370eb3 100644 --- a/docs/content/functions/conv.md +++ b/docs/content/functions/conv.md @@ -12,7 +12,7 @@ to another - generally from a `string` to something else, and vice-versa. **Alias:** `bool` -**Note:** See also [`conv.ToBool`](#conv-tobool) for a more flexible variant. +**Note:** See also [`conv.ToBool`](#convtobool) for a more flexible variant. Converts a true-ish string to a boolean. Can be used to simplify conditional statements based on environment variables or other text input. @@ -55,7 +55,7 @@ types, `""` for strings, `false` for booleans, empty arrays/maps, and `nil`. Note that this will not provide a default for the case where the input is undefined (i.e. referencing things like `.foo` where there is no `foo` field of `.`), but -[`conv.Has`](#conv-has) can be used for that. +[`coll.Has`](../coll/#collhas) can be used for that. _Added in gomplate [v2.5.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.5.0)_ ### Usage @@ -82,7 +82,7 @@ foo bar ``` ## `conv.Dict` _(deprecated)_ -**Deprecation Notice:** Renamed to [`coll.Dict`](#coll-dict) +**Deprecation Notice:** Renamed to [`coll.Dict`](../coll/#colldict) **Alias:** `dict` @@ -94,11 +94,11 @@ set as the value. All keys are converted to strings. This function is equivalent to [Sprig's `dict`](http://masterminds.github.io/sprig/dicts.html#dict) -function, as used in [Helm templates](https://docs.helm.sh/chart_template_guide#template-functions-and-pipelines). +function, as used in [Helm templates](https://helm.sh/docs/chart_template_guide/functions_and_pipelines/). -For creating more complex maps, see [`data.JSON`](../data/#data-json) or [`data.YAML`](../data/#data-yaml). +For creating more complex maps, see [`data.JSON`](../data/#datajson) or [`data.YAML`](../data/#datayaml). -For creating arrays, see [`coll.Slice`](#coll-slice). +For creating arrays, see [`coll.Slice`](../coll/#collslice-_deprecated_). _Added in gomplate [v3.0.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.0.0)_ ### Usage @@ -133,7 +133,7 @@ Hello everybody! ``` ## `conv.Slice` _(deprecated)_ -**Deprecation Notice:** Renamed to [`coll.Slice`](#coll-slice) +**Deprecation Notice:** Renamed to [`coll.Slice`](../coll/#collslice-_deprecated_) **Alias:** `slice` @@ -162,7 +162,7 @@ Hello, Maggie ``` ## `conv.Has` _(deprecated)_ -**Deprecation Notice:** Renamed to [`coll.Has`](#coll-has) +**Deprecation Notice:** Renamed to [`coll.Has`](../coll/#collhas) **Alias:** `has` @@ -232,7 +232,7 @@ $ gomplate -i '{{ $a := coll.Slice 1 2 3 }}{{ join $a "-" }}' **Alias:** `urlParse` -Parses a string as a URL for later use. Equivalent to [url.Parse](https://golang.org/pkg/net/url/#Parse) +Parses a string as a URL for later use. Equivalent to [url.Parse](https://pkg.go.dev/net/url/#Parse) Any of `url.URL`'s methods can be called on the result. @@ -273,9 +273,9 @@ https://user:xxxxx@example.com ## `conv.ParseInt` -_**Note:**_ See [`conv.ToInt64`](#conv-toint64) instead for a simpler and more flexible variant of this function. +_**Note:**_ See [`conv.ToInt64`](#convtoint64) instead for a simpler and more flexible variant of this function. -Parses a string as an int64. Equivalent to [strconv.ParseInt](https://golang.org/pkg/strconv/#ParseInt) +Parses a string as an int64. Equivalent to [strconv.ParseInt](https://pkg.go.dev/strconv/#ParseInt) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage @@ -301,9 +301,9 @@ The value in decimal is 1984 ## `conv.ParseFloat` -_**Note:**_ See [`conv.ToFloat`](#conv-tofloat) instead for a simpler and more flexible variant of this function. +_**Note:**_ See [`conv.ToFloat64`](#convtofloat64) instead for a simpler and more flexible variant of this function. -Parses a string as an float64 for later use. Equivalent to [strconv.ParseFloat](https://golang.org/pkg/strconv/#ParseFloat) +Parses a string as an float64 for later use. Equivalent to [strconv.ParseFloat](https://pkg.go.dev/strconv/#ParseFloat) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage @@ -330,7 +330,7 @@ pi is greater than 3 ## `conv.ParseUint` -Parses a string as an uint64 for later use. Equivalent to [strconv.ParseUint](https://golang.org/pkg/strconv/#ParseUint) +Parses a string as an uint64 for later use. Equivalent to [strconv.ParseUint](https://pkg.go.dev/strconv/#ParseUint) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage @@ -356,9 +356,9 @@ $ BIG=FFFFFFFFFFFFFFFF gomplate < input.tmpl ## `conv.Atoi` -_**Note:**_ See [`conv.ToInt`](#conv-toint) and [`conv.ToInt64`](#conv-toint64) instead for simpler and more flexible variants of this function. +_**Note:**_ See [`conv.ToInt`](#convtoint) and [`conv.ToInt64`](#convtoint64) instead for simpler and more flexible variants of this function. -Parses a string as an int for later use. Equivalent to [strconv.Atoi](https://golang.org/pkg/strconv/#Atoi) +Parses a string as an int for later use. Equivalent to [strconv.Atoi](https://pkg.go.dev/strconv/#Atoi) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage @@ -490,7 +490,7 @@ $ gomplate -i '{{conv.ToInt64 true }}' ## `conv.ToInt` Converts the input to an `int` (signed integer, 32- or 64-bit depending -on platform). This is similar to [`conv.ToInt64`](#conv-toint64) on 64-bit +on platform). This is similar to [`conv.ToInt64`](#convtoint64) on 64-bit platforms, but is useful when input to another function must be provided as an `int`. @@ -501,7 +501,7 @@ the result is `-1`. This is done to protect against [CWE-190](https://cwe.mitre.org/data/definitions/190.html) and [CWE-681](https://cwe.mitre.org/data/definitions/681.html). -See also [`conv.ToInt64`](#conv-toint64). +See also [`conv.ToInt64`](#convtoint64). _Added in gomplate [v2.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.2.0)_ ### Usage @@ -537,7 +537,7 @@ Converts the inputs to an array of `int64`s. Unconvertable inputs will result in errors. -This delegates to [`conv.ToInt64`](#conv-toint64) for each input argument. +This delegates to [`conv.ToInt64`](#convtoint64) for each input argument. _Added in gomplate [v2.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.2.0)_ ### Usage @@ -565,7 +565,7 @@ Converts the inputs to an array of `int`s. Unconvertable inputs will result in errors. -This delegates to [`conv.ToInt`](#conv-toint) for each input argument. +This delegates to [`conv.ToInt`](#convtoint) for each input argument. _Added in gomplate [v2.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.2.0)_ ### Usage @@ -625,7 +625,7 @@ Converts the inputs to an array of `float64`s. Unconvertable inputs will result in errors. -This delegates to [`conv.ToFloat64`](#conv-tofloat64) for each input argument. +This delegates to [`conv.ToFloat64`](#convtofloat64) for each input argument. _Added in gomplate [v2.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.2.0)_ ### Usage @@ -681,7 +681,7 @@ nil Converts the inputs (of any type) to an array of `string`s -This delegates to [`conv.ToString`](#conv-tostring) for each input argument. +This delegates to [`conv.ToString`](#convtostring) for each input argument. _Added in gomplate [v2.5.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.5.0)_ ### Usage diff --git a/docs/content/functions/crypto.md b/docs/content/functions/crypto.md index 5e50d8498..c049e3334 100644 --- a/docs/content/functions/crypto.md +++ b/docs/content/functions/crypto.md @@ -56,7 +56,7 @@ uses AES-256-CBC, but supports 128- and 192-bit keys as well. This function prints the output as a string. Note that this may result in unreadable text if the decrypted payload is binary. See -[`crypto.DecryptAESBytes`](#crypto.DecryptAESBytes) for another method. +[`crypto.DecryptAESBytes`](#cryptodecryptaesbytes-_experimental_) for another method. This function is suitable for decrypting data that was encrypted by Helm's `encryptAES` function, when the input is base64-decoded, and when @@ -377,14 +377,14 @@ $ gomplate -i '{{ crypto.PBKDF2 "foo" "bar" 1024 8 }}' Decrypt an RSA-encrypted input and print the output as a string. Note that this may result in unreadable text if the decrypted payload is binary. See -[`crypto.RSADecryptBytes`](#crypto.RSADecryptBytes) for a safer method. +[`crypto.RSADecryptBytes`](#cryptorsadecryptbytes-_experimental_) for a safer method. The private key must be a PEM-encoded RSA private key in PKCS#1, ASN.1 DER form, which typically begins with `-----BEGIN RSA PRIVATE KEY-----`. The input text must be plain ciphertext, as a byte array, or safely convertible to a byte array. To decrypt base64-encoded input, you must -first decode with the [`base64.DecodeBytes`](../base64/#base64.DecodeBytes) +first decode with the [`base64.DecodeBytes`](../base64/#base64decodebytes) function. _Added in gomplate [v3.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.8.0)_ @@ -431,10 +431,10 @@ form, which typically begins with `-----BEGIN RSA PRIVATE KEY-----`. The input text must be plain ciphertext, as a byte array, or safely convertible to a byte array. To decrypt base64-encoded input, you must -first decode with the [`base64.DecodeBytes`](../base64/#base64.DecodeBytes) +first decode with the [`base64.DecodeBytes`](../base64/#base64decodebytes) function. -See [`crypto.RSADecrypt`](#crypto.RSADecrypt) for a function that outputs +See [`crypto.RSADecrypt`](#cryptorsadecrypt-_experimental_) for a function that outputs a string. _Added in gomplate [v3.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.8.0)_ @@ -484,13 +484,13 @@ which typically begins with `BEGIN PUBLIC KEY`. RSA public keys in PKCS#1 ASN.1 DER form are also supported (beginning with `RSA PUBLIC KEY`). The output will not be encoded, so consider -[base64-encoding](../base64/#base64.Encode) it for display. +[base64-encoding](../base64/#base64encode) it for display. _Note:_ Output encrypted with this function will _not_ be deterministic, so encrypting the same input twice will not result in the same ciphertext. _Warning:_ Using this function may not be safe. See the warning on Go's -[`rsa.EncryptPKCS1v15`](https://golang.org/pkg/crypto/rsa/#EncryptPKCS1v15) +[`rsa.EncryptPKCS1v15`](https://pkg.go.dev/crypto/rsa/#EncryptPKCS1v15) documentation. _Added in gomplate [v3.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.8.0)_ @@ -686,7 +686,7 @@ LCa0a2j/xo/5m0U8HTBBNBNCLXBkg7+g+YpeiGJm564= ## `crypto.WPAPSK` -This is really an alias to [`crypto.PBKDF2`](#crypto.PBKDF2) with the +This is really an alias to [`crypto.PBKDF2`](#cryptopbkdf2) with the values necessary to convert ASCII passphrases to the WPA pre-shared keys for use with WiFi networks. This can be used, for example, to help generate a configuration for [wpa_supplicant](http://w1.fi/wpa_supplicant/). diff --git a/docs/content/functions/data.md b/docs/content/functions/data.md index 1c3821572..7a504be1c 100644 --- a/docs/content/functions/data.md +++ b/docs/content/functions/data.md @@ -11,7 +11,7 @@ A collection of functions that retrieve, parse, and convert structured data. **Alias:** `ds` -Parses a given datasource (provided by the [`--datasource/-d`](../../usage/#datasource-d) argument or [`defineDatasource`](#definedatasource)). +Parses a given datasource (provided by the [`--datasource/-d`](../../usage/#--datasource-d) argument or [`defineDatasource`](#definedatasource)). If the `alias` is undefined, but is a valid URL, `datasource` will dynamically read from that URL. @@ -46,7 +46,7 @@ Hello Dave ## `datasourceExists` Tests whether or not a given datasource was defined on the commandline (with the -[`--datasource/-d`](../../usage/#datasource-d) argument). This is intended mainly to allow +[`--datasource/-d`](../../usage/#--datasource-d) argument). This is intended mainly to allow a template to be rendered differently whether or not a given datasource was defined. @@ -122,7 +122,7 @@ Datasource-person ## `defineDatasource` -Define a datasource alias with target URL inside the template. Overridden by the [`--datasource/-d`](../../usage/#datasource-d) flag. +Define a datasource alias with target URL inside the template. Overridden by the [`--datasource/-d`](../../usage/#--datasource-d) flag. Note: once a datasource is defined, it can not be redefined (i.e. if this function is called twice with the same alias, only the first applies). @@ -160,7 +160,7 @@ Hello Daisy ## `include` -Includes the content of a given datasource (provided by the [`--datasource/-d`](../../usage/#datasource-d) argument). +Includes the content of a given datasource (provided by the [`--datasource/-d`](../../usage/#--datasource-d) argument). This is similar to [`datasource`](#datasource), except that the data is not parsed. There is no restriction on the type of data included, except that it should be textual. @@ -175,7 +175,7 @@ include alias [subpath] | name | description | |------|-------------| -| `alias` | _(required)_ the datasource alias, as provided by [`--datasource/-d`](../../usage/#datasource-d) | +| `alias` | _(required)_ the datasource alias, as provided by [`--datasource/-d`](../../usage/#--datasource-d) | | `subpath` | _(optional)_ the subpath to use, if supported by the datasource | ### Examples @@ -210,7 +210,7 @@ $ gomplate -d person.json -f input.tmpl Converts a JSON string into an object. Works for JSON Objects, but will also parse JSON Arrays. Will not parse other valid JSON types. -For more explict JSON Array support, see [`data.JSONArray`](#data-jsonarray). +For more explict JSON Array support, see [`data.JSONArray`](#datajsonarray). #### Encrypted JSON support (EJSON) @@ -291,7 +291,7 @@ Hello world Converts a YAML string into an object. Works for YAML Objects but will also parse YAML Arrays. This can be used to access properties of YAML objects. -For more explict YAML Array support, see [`data.JSONArray`](#data-yamlarray). +For more explict YAML Array support, see [`data.JSONArray`](#datayamlarray). _Added in gomplate [v2.0.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.0.0)_ ### Usage @@ -496,7 +496,7 @@ COBOL has 357 keywords. **Alias:** `csvByColumn` -Like [`csvByRow`](#csvByRow), except that the data is presented as a columnar +Like [`csvByRow`](#datacsvbyrow), except that the data is presented as a columnar (column-oriented) map. _Added in gomplate [v2.0.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.0.0)_ @@ -616,7 +616,7 @@ $ gomplate < input.tmpl Converts an object to a pretty-printed (or _indented_) JSON document. Input objects may be the result of functions like `data.JSON`, `data.YAML`, `data.JSONArray`, or `data.YAMLArray` functions, or they could be provided -by a [`datasource`](../general/datasource). +by a [`datasource`](../datasources). The indent string must be provided as an argument. @@ -657,7 +657,7 @@ $ gomplate < input.tmpl Converts an object to a YAML document. Input objects may be the result of `data.JSON`, `data.YAML`, `data.JSONArray`, or `data.YAMLArray` functions, -or they could be provided by a [`datasource`](../general/datasource). +or they could be provided by a [`datasource`](../datasources). _Added in gomplate [v2.0.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.0.0)_ ### Usage @@ -723,14 +723,14 @@ foo = "bar" **Alias:** `toCSV` Converts an object to a CSV document. The input object must be a 2-dimensional -array of strings (a `[][]string`). Objects produced by [`data.CSVByRow`](#conv-csvbyrow) -and [`data.CSVByColumn`](#conv-csvbycolumn) cannot yet be converted back to CSV documents. +array of strings (a `[][]string`). Objects produced by [`data.CSVByRow`](#datacsvbyrow) +and [`data.CSVByColumn`](#datacsvbycolumn) cannot yet be converted back to CSV documents. **Note:** With the exception that a custom delimiter can be used, `data.ToCSV` outputs according to the [RFC 4180](https://tools.ietf.org/html/rfc4180) format, which means that line terminators are `CRLF` (Windows format, or `\r\n`). If you require `LF` (UNIX format, or `\n`), the output can be piped through -[`strings.ReplaceAll`](../strings/#strings-replaceall) to replace `"\r\n"` with `"\n"`. +[`strings.ReplaceAll`](../strings/#stringsreplaceall) to replace `"\r\n"` with `"\n"`. _Added in gomplate [v2.0.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.0.0)_ ### Usage diff --git a/docs/content/functions/env.md b/docs/content/functions/env.md index a0d063003..9a811b543 100644 --- a/docs/content/functions/env.md +++ b/docs/content/functions/env.md @@ -12,7 +12,7 @@ menu: **Alias:** `getenv` -Exposes the [os.Getenv](https://golang.org/pkg/os/#Getenv) function. +Exposes the [os.Getenv](https://pkg.go.dev/os/#Getenv) function. Retrieves the value of the environment variable named by the key. If the variable is unset, but the same variable ending in `_FILE` is set, the contents @@ -57,12 +57,12 @@ Your secret is safe ## `env.ExpandEnv` -Exposes the [os.ExpandEnv](https://golang.org/pkg/os/#ExpandEnv) function. +Exposes the [os.ExpandEnv](https://pkg.go.dev/os/#ExpandEnv) function. Replaces `${var}` or `$var` in the input string according to the values of the current environment variables. References to undefined variables are replaced by the empty string. -Like [`env.Getenv`](#env-getenv), the `_FILE` variant of a variable is used. +Like [`env.Getenv`](#envgetenv), the `_FILE` variant of a variable is used. _Added in gomplate [v2.5.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.5.0)_ ### Usage diff --git a/docs/content/functions/file.md b/docs/content/functions/file.md index f88a8ff64..0067b6e48 100644 --- a/docs/content/functions/file.md +++ b/docs/content/functions/file.md @@ -143,9 +143,9 @@ d ## `file.Stat` -Returns a [`os.FileInfo`](https://golang.org/pkg/os/#FileInfo) describing the named path. +Returns a [`os.FileInfo`](https://pkg.go.dev/os/#FileInfo) describing the named path. -Essentially a wrapper for Go's [`os.Stat`](https://golang.org/pkg/os/#Stat) function. +Essentially a wrapper for Go's [`os.Stat`](https://pkg.go.dev/os/#Stat) function. _Added in gomplate [v2.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.4.0)_ ### Usage @@ -173,13 +173,13 @@ $ gomplate -i '{{ $s := file.Stat "/tmp/foo" }}{{ $s.Mode }} {{ $s.Size }} {{ $s ## `file.Walk` -Like a recursive [`file.ReadDir`](#file-readdir), recursively walks the file tree rooted at `path`, and returns an array of all files and directories contained within. +Like a recursive [`file.ReadDir`](#filereaddir), recursively walks the file tree rooted at `path`, and returns an array of all files and directories contained within. The files are walked in lexical order, which makes the output deterministic but means that for very large directories can be inefficient. Walk does not follow symbolic links. -Similar to Go's [`filepath.Walk`](https://golang.org/pkg/path/filepath/#Walk) function. +Similar to Go's [`filepath.Walk`](https://pkg.go.dev/path/filepath/#Walk) function. _Added in gomplate [v2.6.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.6.0)_ ### Usage diff --git a/docs/content/functions/filepath.md b/docs/content/functions/filepath.md index 9e64c71fd..2f2526382 100644 --- a/docs/content/functions/filepath.md +++ b/docs/content/functions/filepath.md @@ -11,13 +11,13 @@ gomplate's path functions are split into 2 namespaces: This page documents the `filepath` namespace - see also the [`path`](../path) documentation. -These functions are wrappers for Go's [`path/filepath`](https://golang.org/pkg/path/filepath/) package. +These functions are wrappers for Go's [`path/filepath`](https://pkg.go.dev/path/filepath/) package. ## `filepath.Base` 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. -A wrapper for Go's [`filepath.Base`](https://golang.org/pkg/path/filepath/#Base) function. +A wrapper for Go's [`filepath.Base`](https://pkg.go.dev/path/filepath/#Base) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -46,7 +46,7 @@ foo Clean returns the shortest path name equivalent to path by purely lexical processing. -A wrapper for Go's [`filepath.Clean`](https://golang.org/pkg/path/filepath/#Clean) function. +A wrapper for Go's [`filepath.Clean`](https://pkg.go.dev/path/filepath/#Clean) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -75,7 +75,7 @@ $ gomplate -i '{{ filepath.Clean "/tmp//foo/../" }}' Returns all but the last element of path, typically the path's directory. -A wrapper for Go's [`filepath.Dir`](https://golang.org/pkg/path/filepath/#Dir) function. +A wrapper for Go's [`filepath.Dir`](https://pkg.go.dev/path/filepath/#Dir) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -104,7 +104,7 @@ $ gomplate -i '{{ filepath.Dir "/tmp/foo" }}' Returns the file name extension used by path. -A wrapper for Go's [`filepath.Ext`](https://golang.org/pkg/path/filepath/#Ext) function. +A wrapper for Go's [`filepath.Ext`](https://pkg.go.dev/path/filepath/#Ext) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -133,7 +133,7 @@ $ gomplate -i '{{ filepath.Ext "/tmp/foo.csv" }}' Returns the result of replacing each slash (`/`) character in the path with the platform's separator character. -A wrapper for Go's [`filepath.FromSlash`](https://golang.org/pkg/path/filepath/#FromSlash) function. +A wrapper for Go's [`filepath.FromSlash`](https://pkg.go.dev/path/filepath/#FromSlash) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -164,7 +164,7 @@ C:\foo\bar Reports whether the path is absolute. -A wrapper for Go's [`filepath.IsAbs`](https://golang.org/pkg/path/filepath/#IsAbs) function. +A wrapper for Go's [`filepath.IsAbs`](https://pkg.go.dev/path/filepath/#IsAbs) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -195,7 +195,7 @@ the path is relative Joins any number of path elements into a single path, adding a separator if necessary. -A wrapper for Go's [`filepath.Join`](https://golang.org/pkg/path/filepath/#Join) function. +A wrapper for Go's [`filepath.Join`](https://pkg.go.dev/path/filepath/#Join) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -223,7 +223,7 @@ C:\tmp\foo\bar Reports whether name matches the shell file name pattern. -A wrapper for Go's [`filepath.Match`](https://golang.org/pkg/path/filepath/#Match) function. +A wrapper for Go's [`filepath.Match`](https://pkg.go.dev/path/filepath/#Match) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -250,7 +250,7 @@ true Returns a relative path that is lexically equivalent to targetpath when joined to basepath with an intervening separator. -A wrapper for Go's [`filepath.Rel`](https://golang.org/pkg/path/filepath/#Rel) function. +A wrapper for Go's [`filepath.Rel`](https://pkg.go.dev/path/filepath/#Rel) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -279,7 +279,7 @@ Splits path immediately following the final path separator, separating it into a The function returns an array with two values, the first being the diretory, and the second the file. -A wrapper for Go's [`filepath.Split`](https://golang.org/pkg/path/filepath/#Split) function. +A wrapper for Go's [`filepath.Split`](https://pkg.go.dev/path/filepath/#Split) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -310,7 +310,7 @@ dir is C:\tmp\, file is foo Returns the result of replacing each separator character in path with a slash (`/`) character. -A wrapper for Go's [`filepath.ToSlash`](https://golang.org/pkg/path/filepath/#ToSlash) function. +A wrapper for Go's [`filepath.ToSlash`](https://pkg.go.dev/path/filepath/#ToSlash) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -341,7 +341,7 @@ foo/bar/baz 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. -A wrapper for Go's [`filepath.VolumeName`](https://golang.org/pkg/path/filepath/#VolumeName) function. +A wrapper for Go's [`filepath.VolumeName`](https://pkg.go.dev/path/filepath/#VolumeName) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage diff --git a/docs/content/functions/math.md b/docs/content/functions/math.md index 2cf0c9c39..52e594069 100644 --- a/docs/content/functions/math.md +++ b/docs/content/functions/math.md @@ -81,7 +81,7 @@ $ gomplate -i '{{ math.Add 1 2 3 4 }} {{ math.Add 1.5 2 3 }}' ## `math.Ceil` -Returns the least integer value greater than or equal to a given floating-point number. This wraps Go's [`math.Ceil`](https://golang.org/pkg/math/#Ceil). +Returns the least integer value greater than or equal to a given floating-point number. This wraps Go's [`math.Ceil`](https://pkg.go.dev/math/#Ceil). **Note:** the return value of this function is a `float64` so that the special-cases `NaN` and `Inf` can be returned appropriately. @@ -143,7 +143,7 @@ $ gomplate -i '{{ math.Div 8 2 }} {{ math.Div 3 2 }}' ## `math.Floor` -Returns the greatest integer value less than or equal to a given floating-point number. This wraps Go's [`math.Floor`](https://golang.org/pkg/math/#Floor). +Returns the greatest integer value less than or equal to a given floating-point number. This wraps Go's [`math.Floor`](https://pkg.go.dev/math/#Floor). **Note:** the return value of this function is a `float64` so that the special-cases `NaN` and `Inf` can be returned appropriately. @@ -256,7 +256,7 @@ false true ## `math.Max` -Returns the largest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Max`](https://golang.org/pkg/math/#Max) are followed. +Returns the largest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Max`](https://pkg.go.dev/math/#Max) are followed. _Added in gomplate [v2.6.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.6.0)_ ### Usage @@ -280,7 +280,7 @@ $ gomplate -i '{{ math.Max 0 8.0 4.5 "-1.5e-11" }}' ## `math.Min` -Returns the smallest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Min`](https://golang.org/pkg/math/#Min) are followed. +Returns the smallest number provided. If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. The same special-cases as Go's [`math.Min`](https://pkg.go.dev/math/#Min) are followed. _Added in gomplate [v2.6.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.6.0)_ ### Usage @@ -332,7 +332,7 @@ $ gomplate -i '{{ math.Mul 8 8 2 }}' **Alias:** `pow` -Calculate an exponent - _bn_. This wraps Go's [`math.Pow`](https://golang.org/pkg/math/#Pow). If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. +Calculate an exponent - _bn_. This wraps Go's [`math.Pow`](https://pkg.go.dev/math/#Pow). If any values are floating-point numbers, a `float64` is returned, otherwise an `int64` is returned. _Added in gomplate [v2.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.2.0)_ ### Usage diff --git a/docs/content/functions/net.md b/docs/content/functions/net.md index ace350e7f..a8bc85d3e 100644 --- a/docs/content/functions/net.md +++ b/docs/content/functions/net.md @@ -104,11 +104,11 @@ d3ag4hukkh62yn.cloudfront.net. Resolve a DNS [`SRV` service record](https://en.wikipedia.org/wiki/SRV_record). This implementation supports the canonical [RFC2782](https://tools.ietf.org/html/rfc2782) form (i.e. `_Service._Proto.Name`), but other forms are also supported, such as -those served by [Consul's DNS interface](https://www.consul.io/docs/agent/dns.html#standard-lookup). +those served by [Consul's DNS interface](https://developer.hashicorp.com/consul/docs/services/discovery/dns-dynamic-lookups#standard-lookup). When multiple records are returned, this function returns the first. -A [`net.SRV`](https://golang.org/pkg/net/#SRV) data structure is returned. The +A [`net.SRV`](https://pkg.go.dev/net/#SRV) data structure is returned. The following properties are available: - `Target` - _(string)_ the hostname where the service can be reached - `Port` - _(uint16)_ the service's port @@ -147,11 +147,11 @@ $ gomplate -i '{{ net.LookupSRV "_sip._udp.sip.voice.google.com" | toJSONPretty Resolve a DNS [`SRV` service record](https://en.wikipedia.org/wiki/SRV_record). This implementation supports the canonical [RFC2782](https://tools.ietf.org/html/rfc2782) form (i.e. `_Service._Proto.Name`), but other forms are also supported, such as -those served by [Consul's DNS interface](https://www.consul.io/docs/agent/dns.html#standard-lookup). +those served by [Consul's DNS interface](https://developer.hashicorp.com/consul/docs/services/discovery/dns-dynamic-lookups#standard-lookup). This function returns all available SRV records. -An array of [`net.SRV`](https://golang.org/pkg/net/#SRV) data structures is +An array of [`net.SRV`](https://pkg.go.dev/net/#SRV) data structures is returned. For each element, the following properties are available: - `Target` - _(string)_ the hostname where the service can be reached - `Port` - _(uint16)_ the service's port @@ -254,7 +254,7 @@ $ gomplate -i '{{ $ip := net.ParseAddr (net.LookupIP "example.com") -}} ``` ## `net.ParseIP` _(deprecated)_ -**Deprecation Notice:** Use [`net.ParseAddr`](#net-parseaddr) instead. +**Deprecation Notice:** Use [`net.ParseAddr`](#netparseaddr) instead. Parse the given string as an IP address (a `netaddr.IP` from the [`inet.af/netaddr`](https://pkg.go.dev/inet.af/netaddr) package). @@ -327,7 +327,7 @@ true ``` ## `net.ParseIPPrefix` _(deprecated)_ -**Deprecation Notice:** Use [`net.ParsePrefix`](#net-parseprefix) instead. +**Deprecation Notice:** Use [`net.ParsePrefix`](#netparseprefix) instead. Parse the given string as an IP address prefix (CIDR) representing an IP network (a `netaddr.IPPrefix` from the @@ -415,7 +415,7 @@ $ gomplate -i '{{ $range := net.ParseRange "1.2.3.0-1.2.3.233" -}} ``` ## `net.ParseIPRange` _(deprecated)_ -**Deprecation Notice:** Use [`net.ParseRange`](#net-parserange) instead. +**Deprecation Notice:** Use [`net.ParseRange`](#netparserange-_experimental_) instead. Parse the given string as an inclusive range of IP addresses from the same address family (a `netaddr.IPRange` from the [`inet.af/netaddr`][] package). diff --git a/docs/content/functions/path.md b/docs/content/functions/path.md index 9d9330324..e22866174 100644 --- a/docs/content/functions/path.md +++ b/docs/content/functions/path.md @@ -11,13 +11,13 @@ gomplate's path functions are split into 2 namespaces: This page documents the `path` namespace - see also the [`filepath`](../filepath) documentation. -These functions are wrappers for Go's [`path`](https://golang.org/pkg/path/) and [`path/filepath`](https://golang.org/pkg/path/filepath/) packages. +These functions are wrappers for Go's [`path`](https://pkg.go.dev/path/) and [`path/filepath`](https://pkg.go.dev/path/filepath/) packages. ## `path.Base` Returns the last element of path. Trailing slashes are removed before extracting the last element. If the path is empty, Base returns `.`. If the path consists entirely of slashes, Base returns `/`. -A wrapper for Go's [`path.Base`](https://golang.org/pkg/path/#Base) function. +A wrapper for Go's [`path.Base`](https://pkg.go.dev/path/#Base) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -46,7 +46,7 @@ foo Clean returns the shortest path name equivalent to path by purely lexical processing. -A wrapper for Go's [`path.Clean`](https://golang.org/pkg/path/#Clean) function. +A wrapper for Go's [`path.Clean`](https://pkg.go.dev/path/#Clean) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -75,7 +75,7 @@ $ gomplate -i '{{ path.Clean "/tmp//foo/../" }}' Returns all but the last element of path, typically the path's directory. -A wrapper for Go's [`path.Dir`](https://golang.org/pkg/path/#Dir) function. +A wrapper for Go's [`path.Dir`](https://pkg.go.dev/path/#Dir) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -104,7 +104,7 @@ $ gomplate -i '{{ path.Dir "/tmp/foo" }}' Returns the file name extension used by path. -A wrapper for Go's [`path.Ext`](https://golang.org/pkg/path/#Ext) function. +A wrapper for Go's [`path.Ext`](https://pkg.go.dev/path/#Ext) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -133,7 +133,7 @@ $ gomplate -i '{{ path.Ext "/tmp/foo.csv" }}' Reports whether the path is absolute. -A wrapper for Go's [`path.IsAbs`](https://golang.org/pkg/path/#IsAbs) function. +A wrapper for Go's [`path.IsAbs`](https://pkg.go.dev/path/#IsAbs) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -164,7 +164,7 @@ the path is relative Joins any number of path elements into a single path, adding a separating slash if necessary. -A wrapper for Go's [`path.Join`](https://golang.org/pkg/path/#Join) function. +A wrapper for Go's [`path.Join`](https://pkg.go.dev/path/#Join) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -190,7 +190,7 @@ $ gomplate -i '{{ path.Join "/tmp" "foo" "bar" }}' Reports whether name matches the shell file name pattern. -A wrapper for Go's [`path.Match`](https://golang.org/pkg/path/#Match) function. +A wrapper for Go's [`path.Match`](https://pkg.go.dev/path/#Match) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage @@ -219,7 +219,7 @@ Splits path immediately following the final slash, separating it into a director The function returns an array with two values, the first being the directory, and the second the file. -A wrapper for Go's [`path.Split`](https://golang.org/pkg/path/#Split) function. +A wrapper for Go's [`path.Split`](https://pkg.go.dev/path/#Split) function. _Added in gomplate [v2.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.7.0)_ ### Usage diff --git a/docs/content/functions/random.md b/docs/content/functions/random.md index 2a0f27fd9..35641fa52 100644 --- a/docs/content/functions/random.md +++ b/docs/content/functions/random.md @@ -9,7 +9,7 @@ Functions for generating random values. ### About randomness -`gomplate` uses Go's [`math/rand`](https://golang.org/pkg/math/rand/) package +`gomplate` uses Go's [`math/rand`](https://pkg.go.dev/math/rand/) package to generate pseudo-random numbers. Note that these functions are not suitable for use in security-sensitive applications, such as cryptography. However, these functions will not deplete system entropy. diff --git a/docs/content/functions/regexp.md b/docs/content/functions/regexp.md index 2cac1b8a2..992f70858 100644 --- a/docs/content/functions/regexp.md +++ b/docs/content/functions/regexp.md @@ -7,7 +7,7 @@ menu: These functions allow user you to search and modify text with regular expressions. -The syntax of the regular expressions accepted is [Go's `regexp` syntax](https://golang.org/pkg/regexp/syntax/#hdr-Syntax), +The syntax of the regular expressions accepted is [Go's `regexp` syntax](https://pkg.go.dev/regexp/syntax/#hdr-Syntax), and is the same general syntax used by Perl, Python, and other languages. ## `regexp.Find` @@ -16,7 +16,7 @@ Returns a string holding the text of the leftmost match in `input` of the regular expression `expression`. This function provides the same behaviour as Go's -[`regexp.FindString`](https://golang.org/pkg/regexp/#Regexp.FindString) function. +[`regexp.FindString`](https://pkg.go.dev/regexp/#Regexp.FindString) function. _Added in gomplate [v3.1.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.1.0)_ ### Usage @@ -55,7 +55,7 @@ This can be called with 2 or 3 arguments. When called with 2 arguments, the to be returned. This function provides the same behaviour as Go's -[`regexp.FindAllString`](https://golang.org/pkg/regexp/#Regexp.FindAllString) function. +[`regexp.FindAllString`](https://pkg.go.dev/regexp#Regexp.FindAllString) function. _Added in gomplate [v3.1.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.1.0)_ ### Usage @@ -121,7 +121,7 @@ username (hairyhenderson) starts with h! Escapes all regular expression metacharacters in the input. The returned string is a regular expression matching the literal text. This function provides the same behaviour as Go's -[`regexp.QuoteMeta`](https://golang.org/pkg/regexp/#Regexp.QuoteMeta) function. +[`regexp.QuoteMeta`](https://pkg.go.dev/regexp#QuoteMeta) function. _Added in gomplate [v3.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.7.0)_ ### Usage @@ -153,7 +153,7 @@ Replaces matches of a regular expression with the replacement string. The replacement is substituted after expanding variables beginning with `$`. This function provides the same behaviour as Go's -[`regexp.ReplaceAllString`](https://golang.org/pkg/regexp/#Regexp.ReplaceAllString) function. +[`regexp.ReplaceAllString`](https://pkg.go.dev/regexp/#Regexp.ReplaceAllString) function. _Added in gomplate [v1.9.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.9.0)_ ### Usage @@ -192,7 +192,7 @@ The replacement is substituted directly, without expanding variables beginning with `$`. This function provides the same behaviour as Go's -[`regexp.ReplaceAllLiteralString`](https://golang.org/pkg/regexp/#Regexp.ReplaceAllLiteralString) function. +[`regexp.ReplaceAllLiteralString`](https://pkg.go.dev/regexp/#Regexp.ReplaceAllLiteralString) function. _Added in gomplate [v3.1.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.1.0)_ ### Usage @@ -231,11 +231,11 @@ This can be called with 2 or 3 arguments. When called with 2 arguments, the `n` argument (number of matches) will be set to `-1`, causing all sub-strings to be returned. -This is equivalent to [`strings.SplitN`](../strings/#strings-splitn), +This is equivalent to [`strings.SplitN`](../strings/#stringssplitn), except that regular expressions are supported. This function provides the same behaviour as Go's -[`regexp.Split`](https://golang.org/pkg/regexp/#Regexp.Split) function. +[`regexp.Split`](https://pkg.go.dev/regexp/#Regexp.Split) function. _Added in gomplate [v3.1.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.1.0)_ ### Usage diff --git a/docs/content/functions/sockaddr.md b/docs/content/functions/sockaddr.md index b66b1a2f9..e4ebacc69 100644 --- a/docs/content/functions/sockaddr.md +++ b/docs/content/functions/sockaddr.md @@ -209,7 +209,7 @@ $ gomplate -i '{{ sockaddr.GetAllInterfaces | sockaddr.Exclude "type" "ipv6" }}' Returns an array of `IfAddr`s filtered by interfaces that match the given selector's value. -This is the inverse of `sockaddr.Exclude`. See [`sockaddr.Exclude`](#sockaddr.Exclude) for details. +This is the inverse of `sockaddr.Exclude`. See [`sockaddr.Exclude`](#sockaddrexclude) for details. _Added in gomplate [v2.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.4.0)_ ### Usage diff --git a/docs/content/functions/strings.md b/docs/content/functions/strings.md index e8efbdf34..fe37830fa 100644 --- a/docs/content/functions/strings.md +++ b/docs/content/functions/strings.md @@ -10,7 +10,7 @@ menu: Abbreviates a string using `...` (ellipses). Takes an optional offset from the beginning of the string, and a maximum final width (including added ellipses). -_Also see [`strings.Trunc`](#strings-trunc)._ +_Also see [`strings.Trunc`](#stringstrunc)._ _Added in gomplate [v2.6.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.6.0)_ ### Usage @@ -188,7 +188,7 @@ foo: ``` ## `strings.Sort` _(deprecated)_ -**Deprecation Notice:** Use [`coll.Sort`](../coll/#coll-sort) instead +**Deprecation Notice:** Use [`coll.Sort`](../coll/#collsort) instead Returns an alphanumerically-sorted copy of a given string list. @@ -254,7 +254,7 @@ baz ## `strings.Split` -_Not to be confused with [`split`](#split), which is deprecated._ +_Not to be confused with [`split`](#split-_deprecated_), which is deprecated._ Slices `input` into the substrings separated by `separator`, returning a slice of the substrings between those separators. If `input` does not @@ -265,7 +265,7 @@ If `separator` is empty, it will split after each UTF-8 sequence. If both inputs are empty (i.e. `strings.Split "" ""`), it will return an empty slice. -This is equivalent to [`strings.SplitN`](#strings-splitn) with a `count` +This is equivalent to [`strings.SplitN`](#stringssplitn) with a `count` of `-1`. Note that the delimiter is not included in the resulting elements. @@ -305,7 +305,7 @@ Three ## `strings.SplitN` -_Not to be confused with [`splitN`](#splitn), which is deprecated._ +_Not to be confused with [`splitN`](#splitn-_deprecated_), which is deprecated._ Slices `input` into the substrings separated by `separator`, returning a slice of the substrings between those separators. If `input` does not @@ -319,7 +319,7 @@ The `count` determines the number of substrings to return: * `count == 0`: the result is nil (zero substrings) * `count < 0`: all substrings -See [`strings.Split`](#strings-split) for more details. +See [`strings.Split`](#stringssplit) for more details. _Added in gomplate [v1.9.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.9.0)_ ### Usage @@ -393,7 +393,7 @@ Returns a new string consisting of `count` copies of the input string. It errors if `count` is negative or if the length of `input` multiplied by `count` overflows. -This wraps Go's [`strings.Repeat`](https://golang.org/pkg/strings/#Repeat). +This wraps Go's [`strings.Repeat`](https://pkg.go.dev/strings/#Repeat). _Added in gomplate [v2.6.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.6.0)_ ### Usage @@ -673,7 +673,7 @@ foo Returns a string without the provided leading prefix string, if the prefix is present. -This wraps Go's [`strings.TrimPrefix`](https://golang.org/pkg/strings/#TrimPrefix). +This wraps Go's [`strings.TrimPrefix`](https://pkg.go.dev/strings/#TrimPrefix). _Added in gomplate [v2.5.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.5.0)_ ### Usage @@ -733,7 +733,7 @@ foo Returns a string without the provided trailing suffix string, if the suffix is present. -This wraps Go's [`strings.TrimSuffix`](https://golang.org/pkg/strings/#TrimSuffix). +This wraps Go's [`strings.TrimSuffix`](https://pkg.go.dev/strings/#TrimSuffix). _Added in gomplate [v2.6.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.6.0)_ ### Usage @@ -763,7 +763,7 @@ hello, jello Returns a string truncated to the given length. -_Also see [`strings.Abbrev`](#strings-abbrev)._ +_Also see [`strings.Abbrev`](#stringsabbrev)._ _Added in gomplate [v2.6.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.6.0)_ ### Usage @@ -948,7 +948,7 @@ code-points should therefore be measured with `strings.RuneCount`. Inputs will first be converted to strings, and multiple inputs are concatenated. -This wraps Go's [`utf8.RuneCountInString`](https://golang.org/pkg/unicode/utf8/#RuneCountInString) +This wraps Go's [`utf8.RuneCountInString`](https://pkg.go.dev/unicode/utf8/#RuneCountInString) function. _Added in gomplate [v3.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.4.0)_ @@ -977,12 +977,12 @@ $ gomplate -i '{{ range (coll.Slice "\u03a9" "\u0030" "\u1430") }}{{ printf "%s ``` ## `contains` _(deprecated)_ -**Deprecation Notice:** Use [`strings.Contains`](#strings-contains) instead +**Deprecation Notice:** Use [`strings.Contains`](#stringscontains) instead -**See [`strings.Contains`](#strings-contains) for a pipeline-compatible version** +**See [`strings.Contains`](#stringscontains) for a pipeline-compatible version** Contains reports whether the second string is contained within the first. Equivalent to -[strings.Contains](https://golang.org/pkg/strings#Contains) +[strings.Contains](https://pkg.go.dev/strings#Contains) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage @@ -1013,12 +1013,12 @@ no ``` ## `hasPrefix` _(deprecated)_ -**Deprecation Notice:** Use [`strings.HasPrefix`](#strings-hasprefix) instead +**Deprecation Notice:** Use [`strings.HasPrefix`](#stringshasprefix) instead -**See [`strings.HasPrefix`](#strings-hasprefix) for a pipeline-compatible version** +**See [`strings.HasPrefix`](#stringshasprefix) for a pipeline-compatible version** Tests whether the string begins with a certain substring. Equivalent to -[strings.HasPrefix](https://golang.org/pkg/strings#HasPrefix) +[strings.HasPrefix](https://pkg.go.dev/strings#HasPrefix) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage @@ -1049,12 +1049,12 @@ foo ``` ## `hasSuffix` _(deprecated)_ -**Deprecation Notice:** Use [`strings.HasSuffix`](#strings-hassuffix) instead +**Deprecation Notice:** Use [`strings.HasSuffix`](#stringshassuffix) instead -**See [`strings.HasSuffix`](#strings-hassuffix) for a pipeline-compatible version** +**See [`strings.HasSuffix`](#stringshassuffix) for a pipeline-compatible version** Tests whether the string ends with a certain substring. Equivalent to -[strings.HasSuffix](https://golang.org/pkg/strings#HasSuffix) +[strings.HasSuffix](https://pkg.go.dev/strings#HasSuffix) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage @@ -1083,12 +1083,12 @@ http://example.com:80 ``` ## `split` _(deprecated)_ -**Deprecation Notice:** Use [`strings.Split`](#strings-split) instead +**Deprecation Notice:** Use [`strings.Split`](#stringssplit) instead -**See [`strings.Split`](#strings-split) for a pipeline-compatible version** +**See [`strings.Split`](#stringssplit) for a pipeline-compatible version** Creates a slice by splitting a string on a given delimiter. Equivalent to -[strings.Split](https://golang.org/pkg/strings#Split) +[strings.Split](https://pkg.go.dev/strings#Split) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage @@ -1115,12 +1115,12 @@ Hello, Maggie ``` ## `splitN` _(deprecated)_ -**Deprecation Notice:** Use [`strings.SplitN`](#strings-splitn) instead +**Deprecation Notice:** Use [`strings.SplitN`](#stringssplitn) instead -**See [`strings.SplitN`](#strings-splitn) for a pipeline-compatible version** +**See [`strings.SplitN`](#stringssplitn) for a pipeline-compatible version** Creates a slice by splitting a string on a given delimiter. The count determines -the number of substrings to return. Equivalent to [strings.SplitN](https://golang.org/pkg/strings#SplitN) +the number of substrings to return. Equivalent to [strings.SplitN](https://pkg.go.dev/strings#SplitN) _Added in gomplate [v1.7.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.7.0)_ ### Usage @@ -1147,12 +1147,12 @@ bar:baz ``` ## `trim` _(deprecated)_ -**Deprecation Notice:** Use [`strings.Trim`](#strings-trim) instead +**Deprecation Notice:** Use [`strings.Trim`](#stringstrim) instead -**See [`strings.Trim`](#strings-trim) for a pipeline-compatible version** +**See [`strings.Trim`](#stringstrim) for a pipeline-compatible version** Trims a string by removing the given characters from the beginning and end of -the string. Equivalent to [strings.Trim](https://golang.org/pkg/strings/#Trim) +the string. Equivalent to [strings.Trim](https://pkg.go.dev/strings/#Trim) _Added in gomplate [v1.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.4.0)_ ### Usage diff --git a/docs/content/functions/test.md b/docs/content/functions/test.md index 1f32a3446..d37f29201 100644 --- a/docs/content/functions/test.md +++ b/docs/content/functions/test.md @@ -94,7 +94,7 @@ In addition, the special kind `number` is accepted by this function, to represent _any_ numeric kind (whether `float32`, `uint8`, or whatever). This is useful when the specific numeric type is unknown. -See also [`test.Kind`](test-kind). +See also [`test.Kind`](#testkind). _Added in gomplate [v3.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.8.0)_ ### Usage @@ -146,7 +146,7 @@ have a type of `[]string`, the _kind_ of that slice will simply be `slice`. If you need to know the precise type of a value, use `printf "%T" $value`. -See also [`test.IsKind`](test-iskind). +See also [`test.IsKind`](#testiskind). _Added in gomplate [v3.8.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.8.0)_ ### Usage @@ -233,7 +233,7 @@ template: :1:7: executing "" at <"config">: map has no entry for key " **Alias:** `ternary` -Returns one of two values depending on whether the third is true. Note that the third value does not have to be a boolean - it is converted first by the [`conv.ToBool`](../conv/#conv-tobool) function (values like `true`, `1`, `"true"`, `"Yes"`, etc... are considered true). +Returns one of two values depending on whether the third is true. Note that the third value does not have to be a boolean - it is converted first by the [`conv.ToBool`](../conv/#convtobool) function (values like `true`, `1`, `"true"`, `"Yes"`, etc... are considered true). This is effectively a short-form of the following template: diff --git a/docs/content/functions/time.md b/docs/content/functions/time.md index 13937d6ec..cb93aef7f 100644 --- a/docs/content/functions/time.md +++ b/docs/content/functions/time.md @@ -5,9 +5,9 @@ menu: parent: functions --- -This namespace wraps Go's [`time` package](https://golang.org/pkg/time/), and a +This namespace wraps Go's [`time` package](https://pkg.go.dev/time/), and a few of the functions return a `time.Time` value. All of the -[`time.Time` functions](https://golang.org/pkg/time/#Time) can then be used to +[`time.Time` functions](https://pkg.go.dev/time/#Time) can then be used to convert, adjust, or format the time in your template. ### Reference time @@ -51,9 +51,9 @@ See below for examples of how these layouts can be used. #### durations -Some operations (such as [`Time.Add`](https://golang.org/pkg/time/#Time.Add) and -[`Time.Round`](https://golang.org/pkg/time/#Time.Round)) require a -[`Duration`](https://golang.org/pkg/time/#Duration) value. These can be created +Some operations (such as [`Time.Add`](https://pkg.go.dev/time/#Time.Add) and +[`Time.Round`](https://pkg.go.dev/time/#Time.Round)) require a +[`Duration`](https://pkg.go.dev/time/#Duration) value. These can be created conveniently with the following functions: - `time.Nanosecond` @@ -72,11 +72,11 @@ $ gomplate -i '{{ (time.Now).Format time.Kitchen }} 11:05AM ``` -For other durations, such as `2h10m`, [`time.ParseDuration`](#time-parseduration) can be used. +For other durations, such as `2h10m`, [`time.ParseDuration`](#timeparseduration) can be used. ## `time.Now` -Returns the current local time, as a `time.Time`. This wraps [`time.Now`](https://golang.org/pkg/time/#Now). +Returns the current local time, as a `time.Time`. This wraps [`time.Now`](https://pkg.go.dev/time/#Now). Usually, further functions are called using the value returned by `Now`. @@ -90,12 +90,12 @@ time.Now ### Examples -Usage with [`UTC`](https://golang.org/pkg/time/#Time.UTC) and [`Format`](https://golang.org/pkg/time/#Time.Format): +Usage with [`UTC`](https://pkg.go.dev/time/#Time.UTC) and [`Format`](https://pkg.go.dev/time/#Time.Format): ```console $ gomplate -i '{{ (time.Now).UTC.Format "Day 2 of month 1 in year 2006 (timezone MST)" }}' Day 14 of month 10 in year 2017 (timezone UTC) ``` -Usage with [`AddDate`](https://golang.org/pkg/time/#Time.AddDate): +Usage with [`AddDate`](https://pkg.go.dev/time/#Time.AddDate): ```console $ date Sat Oct 14 09:57:02 EDT 2017 @@ -104,7 +104,7 @@ Tue Nov 14 09:57:02 EST 2017 ``` _(notice how the TZ adjusted for daylight savings!)_ -Usage with [`IsDST`](https://golang.org/pkg/time/#Time.IsDST): +Usage with [`IsDST`](https://pkg.go.dev/time/#Time.IsDST): ```console $ gomplate -i '{{ $t := time.Now }}At the tone, the time will be {{ ($t.Round (time.Minute 1)).Add (time.Minute 1) }}. It is{{ if not $t.IsDST }} not{{ end }} daylight savings time. @@ -116,12 +116,12 @@ It is not daylight savings time. ## `time.Parse` -Parses a timestamp defined by the given layout. This wraps [`time.Parse`](https://golang.org/pkg/time/#Parse). +Parses a timestamp defined by the given layout. This wraps [`time.Parse`](https://pkg.go.dev/time/#Parse). A number of pre-defined layouts are provided as constants, defined -[here](https://golang.org/pkg/time/#pkg-constants). +[here](https://pkg.go.dev/time/#pkg-constants). -Just like [`time.Now`](#time-now), this is usually used in conjunction with +Just like [`time.Now`](#timenow), this is usually used in conjunction with other functions. _Note: In the absence of a time zone indicator, `time.Parse` returns a time in UTC._ @@ -145,7 +145,7 @@ timestamp | time.Parse layout ### Examples -Usage with [`Format`](https://golang.org/pkg/time/#Time.Format): +Usage with [`Format`](https://pkg.go.dev/time/#Time.Format): ```console $ gomplate -i '{{ (time.Parse "2006-01-02" "1993-10-23").Format "Monday January 2, 2006 MST" }}' Saturday October 23, 1993 UTC @@ -153,7 +153,7 @@ Saturday October 23, 1993 UTC ## `time.ParseDuration` -Parses a duration string. This wraps [`time.ParseDuration`](https://golang.org/pkg/time/#ParseDuration). +Parses a duration string. This wraps [`time.ParseDuration`](https://pkg.go.dev/time/#ParseDuration). A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as `300ms`, `-1.5h` or `2h45m`. Valid @@ -186,7 +186,7 @@ $ gomplate -i '{{ (time.Now).Format time.Kitchen }} ## `time.ParseLocal` -Same as [`time.Parse`](#time-parse), except that in the absence of a time zone +Same as [`time.Parse`](#timeparse), except that in the absence of a time zone indicator, the timestamp wil be parsed in the local timezone. _Added in gomplate [v2.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.2.0)_ @@ -208,7 +208,7 @@ timestamp | time.ParseLocal layout ### Examples -Usage with [`Format`](https://golang.org/pkg/time/#Time.Format): +Usage with [`Format`](https://pkg.go.dev/time/#Time.Format): ```console $ bin/gomplate -i '{{ (time.ParseLocal time.Kitchen "6:00AM").Format "15:04 MST" }}' 06:00 EST @@ -216,9 +216,9 @@ $ bin/gomplate -i '{{ (time.ParseLocal time.Kitchen "6:00AM").Format "15:04 MST" ## `time.ParseInLocation` -Same as [`time.Parse`](#time-parse), except that the time is parsed in the given location's time zone. +Same as [`time.Parse`](#timeparse), except that the time is parsed in the given location's time zone. -This wraps [`time.ParseInLocation`](https://golang.org/pkg/time/#ParseInLocation). +This wraps [`time.ParseInLocation`](https://pkg.go.dev/time/#ParseInLocation). _Added in gomplate [v2.2.0](https://github.com/hairyhenderson/gomplate/releases/tag/v2.2.0)_ ### Usage @@ -240,7 +240,7 @@ timestamp | time.ParseInLocation layout location ### Examples -Usage with [`Format`](https://golang.org/pkg/time/#Time.Format): +Usage with [`Format`](https://pkg.go.dev/time/#Time.Format): ```console $ gomplate -i '{{ (time.ParseInLocation time.Kitchen "Africa/Luanda" "6:00AM").Format "15:04 MST" }}' 06:00 LMT @@ -248,7 +248,7 @@ $ gomplate -i '{{ (time.ParseInLocation time.Kitchen "Africa/Luanda" "6:00AM").F ## `time.Since` -Returns the time elapsed since a given time. This wraps [`time.Since`](https://golang.org/pkg/time/#Since). +Returns the time elapsed since a given time. This wraps [`time.Since`](https://pkg.go.dev/time/#Since). It is shorthand for `time.Now.Sub t`. @@ -313,7 +313,7 @@ Jan 2 10:17:36.789 ## `time.Until` -Returns the duration until a given time. This wraps [`time.Until`](https://golang.org/pkg/time/#Until). +Returns the duration until a given time. This wraps [`time.Until`](https://pkg.go.dev/time/#Until). It is shorthand for `$t.Sub time.Now`. diff --git a/docs/content/functions/tmpl.md b/docs/content/functions/tmpl.md index 1c16f682e..be7124b92 100644 --- a/docs/content/functions/tmpl.md +++ b/docs/content/functions/tmpl.md @@ -9,7 +9,7 @@ Functions for defining or executing templates. ## `tmpl.Exec` -Execute (render) the named template. This is equivalent to using the [`template`](https://golang.org/pkg/text/template/#hdr-Actions) action, except the result is returned as a string. +Execute (render) the named template. This is equivalent to using the [`template`](https://pkg.go.dev/text/template/#hdr-Actions) action, except the result is returned as a string. This allows for post-processing of templates. diff --git a/docs/content/functions/uuid.md b/docs/content/functions/uuid.md index de228bc9f..8805675ab 100644 --- a/docs/content/functions/uuid.md +++ b/docs/content/functions/uuid.md @@ -21,7 +21,7 @@ this is required for your use-case. Create a version 1 UUID (based on the current MAC address and the current date/time). -Use [`uuid.V4`](#uuid-v4) instead in most cases. +Use [`uuid.V4`](#uuidv4) instead in most cases. _Added in gomplate [v3.4.0](https://github.com/hairyhenderson/gomplate/releases/tag/v3.4.0)_ ### Usage diff --git a/docs/content/installing.md b/docs/content/installing.md index 9b740ef18..5e59791cc 100644 --- a/docs/content/installing.md +++ b/docs/content/installing.md @@ -85,7 +85,7 @@ COPY --from=hairyhenderson/gomplate:stable /gomplate /bin/gomplate Now, `gomplate` will be available in the `/bin` directory inside the container image. -Note that when using `gomplate` with HTTPS-based datasources, you will likely need to install the `ca-certificates` package for your base distribution. Here's an example when using the [`alpine`](https://hub.docker.com/_alpine) base image: +Note that when using `gomplate` with HTTPS-based datasources, you will likely need to install the `ca-certificates` package for your base distribution. Here's an example when using the [`alpine`](https://hub.docker.com/_/alpine) base image: ```Dockerfile FROM alpine diff --git a/docs/content/syntax.md b/docs/content/syntax.md index f058bc43e..e4c9b8f91 100644 --- a/docs/content/syntax.md +++ b/docs/content/syntax.md @@ -51,7 +51,7 @@ Hello, baz! This might not be desirable. -You can use [Golang template syntax](https://golang.org/pkg/text/template/#hdr-Text_and_spaces) to fix this. Leading newlines (i.e. newlines that come before the action) can be suppressed by placing a minus sign in front of the first set of delimiters (`{{`). Putting the minus sign behind the trailing set of delimiters (`}}`) will suppress the newline _after_ the action. You can do both to suppress newlines entirely on that line. +You can use [Golang template syntax](https://pkg.go.dev/text/template/#hdr-Text_and_spaces) to fix this. Leading newlines (i.e. newlines that come before the action) can be suppressed by placing a minus sign in front of the first set of delimiters (`{{`). Putting the minus sign behind the trailing set of delimiters (`}}`) will suppress the newline _after_ the action. You can do both to suppress newlines entirely on that line. Placing the minus sign within the context (i.e. inside of `{{.}}`) has no effect. @@ -264,7 +264,7 @@ The context is foo ``` Templates rendered by gomplate always have a _default_ context. You can populate -the default context from data sources with the [`--context`/`c`](../usage/#context-c) +the default context from data sources with the [`--context`/`c`](../usage/#--context-c) flag. The special context item [`.Env`](#env) is available for referencing the system's environment variables. @@ -286,7 +286,7 @@ but the original context is still map[bar:baz] Gomplate supports nested templates, using Go's `template` action. These can be defined in-line with the `define` action, or external data can be used with the -[`--template`/`-t`](../usage/#template-t) flag. +[`--template`/`-t`](../usage/#--template-t) flag. Note that nested templates do _not_ have access to gomplate's default [context](#the-context) (though it can be explicitly provided to the `template` @@ -317,7 +317,7 @@ Hello everybody! ### External templates To define a nested template from an external source such as a file, use the -[`--template`/`-t`](../usage/#template-t) flag. +[`--template`/`-t`](../usage/#--template-t) flag. _hello.t:_ ``` @@ -347,8 +347,8 @@ this will fail: template: :1:23: executing "" at <.Env.BOGUS>: map has Sometimes, this behaviour is desired; if the output is unusable without certain strings, this is a sure way to know that variables are missing! -If you want different behaviour, try [`getenv`](../functions/env/#env-getenv). +If you want different behaviour, try [`getenv`](../functions/env/#envgetenv). -[`text/template`]: https://golang.org/pkg/text/template/ +[`text/template`]: https://pkg.go.dev/text/template/ [`base64.Encode`]: ../functions/base64#base64-encode [data sources]: ../datasources/ diff --git a/docs/content/usage.md b/docs/content/usage.md index 3d3909780..df59d3452 100644 --- a/docs/content/usage.md +++ b/docs/content/usage.md @@ -6,7 +6,7 @@ menu: main The simplest usage of `gomplate` is to just replace environment variables. All environment variables are available by referencing [`.Env`](../syntax/#env) -(or [`getenv`](../functions/env/#getenv)) in the template. +(or [`getenv`](../functions/env/#envgetenv)) in the template. The template is read from standard in, and written to standard out. @@ -52,7 +52,7 @@ You can specify multiple `--file` and `--out` arguments. The same number of each For processing multiple templates in a directory you can use `--input-dir` and `--output-dir` together. In this case all files in input directory will be processed recursively as templates and the resulting files stored in `--output-dir`. The output directory will be created if it does not exist and the directory structure of the input directory will be preserved. -You can use the [`--exclude`](#exclude) argument and/or a [`.gomplateignore`](#ignorefile) file to exclude some of the files in the input directory. +You can use the [`--exclude`](#--exclude-and---include) argument and/or a [`.gomplateignore`](#gomplateignore-files) file to exclude some of the files in the input directory. Example: @@ -110,7 +110,7 @@ The value must be an octal integer in the standard UNIX `chmod` format, i.e. `64 ### `--exclude` and `--include` -When using the [`--input-dir`](#input-dir-and-output-dir) argument, it can be useful to filter which files are processed. You can use `--exclude` and `--include` to achieve this. The `--exclude` flag takes a [`.gitignore`][]-style pattern, and any files matching the pattern will be excluded. The `--include` flag is effectively the opposite of `--exclude`. You can also repeat the arguments to provide a series of patterns to be excluded/included. +When using the [`--input-dir`](#--input-dir-and---output-dir) argument, it can be useful to filter which files are processed. You can use `--exclude` and `--include` to achieve this. The `--exclude` flag takes a [`.gitignore`][]-style pattern, and any files matching the pattern will be excluded. The `--include` flag is effectively the opposite of `--exclude`. You can also repeat the arguments to provide a series of patterns to be excluded/included. Patterns provided with `--exclude`/`--include` are matched relative to the input directory. @@ -132,7 +132,7 @@ This will cause only files ending in `.tmpl` to be processed, except for files w ### `--exclude-processing` -When using the [`--input-dir`](#input-dir-and-output-dir) argument, it can be useful to skip some files from processing and copy them directly to the output directory. Like the `--exclude` flag, it takes a [`.gitignore`][]-style pattern, and any files match the pattern will be copied. +When using the [`--input-dir`](#--input-dir-and---output-dir) argument, it can be useful to skip some files from processing and copy them directly to the output directory. Like the `--exclude` flag, it takes a [`.gitignore`][]-style pattern, and any files match the pattern will be copied. _Note:_ These patterns are _not_ treated as filesystem globs, and so a pattern like `/foo/bar.json` will match relative to the input directory, not the root of the filesystem as they may appear! @@ -182,7 +182,7 @@ Add a data source in `name=URL` form, and make it available in the [default cont Data sources referenced with `--context` will be immediately loaded before gomplate processes the template. This is in contrast to the `--datasource` behaviour, which lazy-loads data while processing the template. -All other rules for the [`--datasource`/`-d`](#datasource-d) flag apply. +All other rules for the [`--datasource`/`-d`](#--datasource-d) flag apply. Examples: @@ -236,7 +236,7 @@ Use `--left-delim`/`--right-delim` or set `$GOMPLATE_LEFT_DELIM`/`$GOMPLATE_RIGH ### `--template`/`-t` Add a nested template or directory of templates that can be referenced by the -main input template(s) with the [`template`](https://golang.org/pkg/text/template/#hdr-Actions) +main input template(s) with the [`template`](https://pkg.go.dev/text/template/#hdr-Actions) built-in or the functions in the [`tmpl`](../functions/tmpl/) namespace. Specify multiple times to add multiple template references. @@ -327,8 +327,8 @@ Plugins can also be written as PowerShell or CMD scripts (`.ps1`, `.bat`, or `.c extensions) on Windows. By default, plugins will time out after 5 seconds. To adjust this, set the -`GOMPLATE_PLUGIN_TIMEOUT` environment variable to a valid [duration](../functions/time/#time-parseduration) -such as `10s` or `3m`, or use the [`pluginTimeout`](../config/#pluginTimeout) +`GOMPLATE_PLUGIN_TIMEOUT` environment variable to a valid [duration](../functions/time/#timeparseduration) +such as `10s` or `3m`, or use the [`pluginTimeout`](../config/#plugintimeout) configuration option. ### `--exec-pipe` @@ -365,7 +365,7 @@ command will work as expected, without the log output interfering. The `GOMPLATE_LOG_FORMAT` environment variable can be used to control the format of the log messages that gomplate may output, whether error messages or debug -messages when the [`--verbose`](#verbose) option is in use. +messages when the [`--verbose`](#--verbose) option is in use. The value can be set to `json` or `logfmt`. @@ -421,7 +421,7 @@ $ gomplate -i 'hello world' -o out.txt -- cat out.txt hello world ``` -See also [`--exec-pipe`](#exec-pipe) for piping output directly into the +See also [`--exec-pipe`](#--exec-pipe) for piping output directly into the post-exec command. ## Empty output