Skip to content

Commit

Permalink
Add unreleased label to docs
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Henderson <[email protected]>
  • Loading branch information
hairyhenderson committed Sep 29, 2023
1 parent 9ff1457 commit 2268efe
Show file tree
Hide file tree
Showing 25 changed files with 885 additions and 619 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ report.xml
*.iid
*.out
.netlify
docs/.hugo_build.lock
8 changes: 8 additions & 0 deletions docs-src/content/functions/func_doc.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ menu:
{{ $data.preamble -}}

{{- define "annotations" -}}
{{ if not (has . "released") }}_(unreleased)_{{ end -}}
{{ if has . "deprecated" }} _(deprecated)_{{ end -}}
{{ if and (has . "experimental") (index . "experimental") }} _(experimental)_{{ end -}}
{{ end -}}

{{ range $_, $f := $data.funcs }}
## {{ if has $f "rawName" -}}
{{ $f.rawName }}{{ else }}`{{ $f.name }}`{{ end }}{{ template "annotations" $f }}
{{ if not (has . "released") -}}
**Unreleased:** _This function has not yet been included in a release of gomplate._
{{ end -}}
{{ if has $f "deprecated" -}}
**Deprecation Notice:** {{ $f.deprecated }}
{{ end -}}
Expand All @@ -49,6 +53,10 @@ menu:
{{ $f.description }}
{{ end -}}

{{ if has . "released" -}}
_Added in gomplate [{{ $f.released }}](https://github.com/hairyhenderson/gomplate/releases/tag/{{ $f.released }})_
{{ end -}}

{{ template "usage" $f }}

{{ if has $f "arguments" -}}
Expand Down
11 changes: 11 additions & 0 deletions docs-src/content/functions/strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ns: strings
preamble: ''
funcs:
- name: strings.Abbrev
released: v2.6.0
description: |
Abbreviates a string using `...` (ellipses). Takes an optional offset from the beginning of the string, and a maximum final width (including added ellipses).
Expand All @@ -24,6 +25,7 @@ funcs:
$ gomplate -i '{{ "foobarbazquxquux" | strings.Abbrev 6 9 }}'
...baz...
- name: strings.Contains
released: v1.9.0
description: |
Reports whether a substring is contained within a string.
pipeline: true
Expand All @@ -48,6 +50,7 @@ funcs:
no
```
- name: strings.HasPrefix
released: v1.9.0
description: |
Tests whether a string begins with a certain prefix.
pipeline: true
Expand All @@ -65,6 +68,7 @@ funcs:
$ URL=https://example.com gomplate -i '{{if .Env.URL | strings.HasPrefix "https"}}foo{{else}}bar{{end}}'
foo
- name: strings.HasSuffix
released: v1.9.0
description: |
Tests whether a string ends with a certain suffix.
pipeline: true
Expand All @@ -87,6 +91,7 @@ funcs:
http://example.com:80
```
- name: strings.Indent
released: v1.9.0
alias: indent
description: |
Indents a string. If the input string has multiple lines, each line will be indented.
Expand Down Expand Up @@ -125,6 +130,7 @@ funcs:
quuz: 42
```
- name: strings.Sort
released: v2.7.0
deprecated: Use [`coll.Sort`](../coll/#coll-sort) instead
description: |
Returns an alphanumerically-sorted copy of a given string list.
Expand Down Expand Up @@ -161,6 +167,7 @@ funcs:
bar
baz
- name: strings.Split
released: v1.9.0
description: |
_Not to be confused with [`split`](#split), which is deprecated._
Expand Down Expand Up @@ -198,6 +205,7 @@ funcs:
Two
Three
- name: strings.SplitN
released: v1.9.0
description: |
_Not to be confused with [`splitN`](#splitn), which is deprecated._
Expand Down Expand Up @@ -232,6 +240,7 @@ funcs:
foo
bar:baz
- name: strings.Quote
released: v3.1.0
alias: quote
description: |
Surrounds an input string with double-quote characters (`"`). If the input is not a string, converts first.
Expand All @@ -255,6 +264,7 @@ funcs:
$ gomplate -i '{{ strings.Quote 500 }}'
"500"
- name: strings.Repeat
released: v2.6.0
description: |
Returns a new string consisting of `count` copies of the input string.
Expand All @@ -274,6 +284,7 @@ funcs:
$ gomplate -i '{{ "hello " | strings.Repeat 5 }}'
hello hello hello hello hello
- name: strings.ReplaceAll
released: v1.9.0
alias: replaceAll
description: |
Replaces all occurrences of a given string with another.
Expand Down
1 change: 1 addition & 0 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: gomplate
type: index
archetype: "home"
weight: 1
menu:
main:
Expand Down
54 changes: 32 additions & 22 deletions docs/content/functions/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ for details.
| `AWS_REGION` | Specifies where to send requests. See [this list](https://docs.aws.amazon.com/general/latest/gr/rande.html). Note that the region must be set for AWS functions to work correctly, either through this variable, through a configuration profile, or by running on an EC2 instance. |
| `AWS_META_ENDPOINT` | _(Default `http://169.254.169.254`)_ Sets the base address of the instance metadata service. |

## `aws.EC2Meta`
## `aws.EC2Meta`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

**Alias:** `ec2meta`

Expand All @@ -33,7 +34,7 @@ For times when running outside EC2, or when the metadata API can't be reached, a

### Usage

```go
```
aws.EC2Meta key [default]
```

Expand All @@ -51,7 +52,8 @@ $ echo '{{aws.EC2Meta "instance-id"}}' | gomplate
i-12345678
```

## `aws.EC2Dynamic`
## `aws.EC2Dynamic`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

**Alias:** `ec2dynamic`

Expand All @@ -61,7 +63,7 @@ For times when running outside EC2, or when the metadata API can't be reached, a

### Usage

```go
```
aws.EC2Dynamic key [default]
```

Expand All @@ -79,7 +81,8 @@ $ echo '{{ (aws.EC2Dynamic "instance-identity/document" | json).region }}' | gom
us-east-1
```

## `aws.EC2Region`
## `aws.EC2Region`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

**Alias:** `ec2region`

Expand All @@ -88,7 +91,7 @@ Queries AWS to get the region. An optional default can be provided, or returns

### Usage

```go
```
aws.EC2Region [default]
```

Expand All @@ -113,7 +116,8 @@ $ echo '{{ aws.EC2Region "foo" }}' | ./gomplate
foo
```

## `aws.EC2Tag`
## `aws.EC2Tag`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

**Alias:** `ec2tag`

Expand All @@ -122,7 +126,7 @@ can be provided.

### Usage

```go
```
aws.EC2Tag tag [default]
```

Expand All @@ -144,15 +148,16 @@ $ echo 'I am a {{ aws.EC2Tag "classification" "meat popsicle" }}.' | ./gomplate
I am a meat popsicle.
```

## `aws.EC2Tags`
## `aws.EC2Tags`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

**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).

### Usage

```go
```
aws.EC2Tags
```

Expand All @@ -170,7 +175,8 @@ Name=bar
svc:name=foobar
```

## `aws.KMSEncrypt`
## `aws.KMSEncrypt`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

Encrypt an input string with the AWS Key Management Service (KMS).

Expand All @@ -195,10 +201,10 @@ See also [`aws.KMSDecrypt`](#aws-kmsdecrypt).

### Usage

```go
```
aws.KMSEncrypt keyID input
```
```go
```
input | aws.KMSEncrypt keyID
```

Expand All @@ -216,7 +222,8 @@ $ export CIPHER=$(gomplate -i '{{ aws.KMSEncrypt "alias/gomplate" "hello world"
$ gomplate -i '{{ env.Getenv "CIPHER" | aws.KMSDecrypt }}'
```

## `aws.KMSDecrypt`
## `aws.KMSDecrypt`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

Decrypt ciphertext that was encrypted with the AWS Key Management Service
(KMS).
Expand All @@ -230,10 +237,10 @@ See also [`aws.KMSEncrypt`](#aws-kmsencrypt).

### Usage

```go
```
aws.KMSDecrypt input
```
```go
```
input | aws.KMSDecrypt
```

Expand All @@ -250,7 +257,8 @@ $ export CIPHER=$(gomplate -i '{{ aws.KMSEncrypt "alias/gomplate" "hello world"
$ gomplate -i '{{ env.Getenv "CIPHER" | aws.KMSDecrypt }}'
```

## `aws.Account`
## `aws.Account`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

Returns the currently-authenticated AWS account ID number.

Expand All @@ -260,7 +268,7 @@ See also [`aws.UserID`](#aws-userid) and [`aws.ARN`](#aws-arn).

### Usage

```go
```
aws.Account
```

Expand All @@ -272,7 +280,8 @@ $ gomplate -i 'My account is {{ aws.Account }}'
My account is 123456789012
```

## `aws.ARN`
## `aws.ARN`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

Returns the AWS ARN (Amazon Resource Name) associated with the current authentication credentials.

Expand All @@ -282,7 +291,7 @@ See also [`aws.UserID`](#aws-userid) and [`aws.Account`](#aws-account).

### Usage

```go
```
aws.ARN
```

Expand All @@ -294,7 +303,8 @@ $ gomplate -i 'Calling from {{ aws.ARN }}'
Calling from arn:aws:iam::123456789012:user/Alice
```

## `aws.UserID`
## `aws.UserID`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

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
Expand All @@ -307,7 +317,7 @@ See also [`aws.ARN`](#aws-arn) and [`aws.Account`](#aws-account).

### Usage

```go
```
aws.UserID
```

Expand Down
19 changes: 11 additions & 8 deletions docs/content/functions/base64.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ menu:
---


## `base64.Encode`
## `base64.Encode`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

Encode data as a Base64 string. Specifically, this uses the standard Base64 encoding as defined in [RFC4648 &sect;4](https://tools.ietf.org/html/rfc4648#section-4) (and _not_ the URL-safe encoding).

### Usage

```go
```
base64.Encode input
```
```go
```
input | base64.Encode
```

Expand All @@ -36,7 +37,8 @@ $ gomplate -i '{{ "hello world" | base64.Encode }}'
aGVsbG8gd29ybGQ=
```

## `base64.Decode`
## `base64.Decode`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

Decode a Base64 string. This supports both standard ([RFC4648 &sect;4](https://tools.ietf.org/html/rfc4648#section-4)) and URL-safe ([RFC4648 &sect;5](https://tools.ietf.org/html/rfc4648#section-5)) encodings.

Expand All @@ -46,10 +48,10 @@ for binary data.

### Usage

```go
```
base64.Decode input
```
```go
```
input | base64.Decode
```

Expand All @@ -70,7 +72,8 @@ $ gomplate -i '{{ "aGVsbG8gd29ybGQ=" | base64.Decode }}'
hello world
```

## `base64.DecodeBytes`
## `base64.DecodeBytes`_(unreleased)_
**Unreleased:** _This function has not yet been included in a release of gomplate._

Decode a Base64 string. This supports both standard ([RFC4648 &sect;4](https://tools.ietf.org/html/rfc4648#section-4)) and URL-safe ([RFC4648 &sect;5](https://tools.ietf.org/html/rfc4648#section-5)) encodings.

Expand All @@ -80,7 +83,7 @@ Use [`base64.Decode`](#base64.Decode) to output a plain string.

### Usage

```go
```
base64.DecodeBytes input
```

Expand Down
Loading

0 comments on commit 2268efe

Please sign in to comment.