diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2020-08-19 20:10:34 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2020-08-19 22:14:48 -0400 |
| commit | ee9947b14364fd0efaf480002d1ff4f6b057270c (patch) | |
| tree | 135e6a9433d57ec90218dd9f0124e6780e5c0d3a /docs-src | |
| parent | 6f397786018640b0f4829a5fad86170cedcd5a4b (diff) | |
Fall back to JSON/YAML arrays when parsing datasources
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs-src')
| -rw-r--r-- | docs-src/content/functions/data.yml | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/docs-src/content/functions/data.yml b/docs-src/content/functions/data.yml index a512c078..15106372 100644 --- a/docs-src/content/functions/data.yml +++ b/docs-src/content/functions/data.yml @@ -5,7 +5,7 @@ funcs: - name: datasource alias: ds description: | - Parses a given datasource (provided by the [`--datasource/-d`](#--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. @@ -32,7 +32,7 @@ funcs: - name: datasourceExists description: | Tests whether or not a given datasource was defined on the commandline (with the - [`--datasource/-d`](#--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. @@ -64,7 +64,7 @@ funcs: no worries - name: defineDatasource description: | - Define a datasource alias with target URL inside the template. Overridden by the [`--datasource/-d`](#--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). @@ -94,14 +94,14 @@ funcs: ``` - name: include 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 @@ -132,7 +132,10 @@ funcs: - name: data.JSON alias: json description: | - Converts a JSON string into an object. Only works for JSON Objects (not Arrays or other valid JSON types). This can be used to access properties of JSON objects. + 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). #### Encrypted JSON support (EJSON) @@ -182,7 +185,10 @@ funcs: - name: data.YAML alias: yaml description: | - Converts a YAML string into an object. Only works for YAML Objects (not Arrays or other valid YAML types). This can be used to access properties of YAML objects. + 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). pipeline: true arguments: - name: in |
