Skip to content

Commit e8cad87

Browse files
Update README.md
Co-authored-by: CodeShell <122738806+CodeShellDev@users.noreply.github.com>
1 parent f459ee7 commit e8cad87

1 file changed

Lines changed: 35 additions & 10 deletions

File tree

README.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [Usage](#usage)
1313
- [File Functions](#file-functions)
1414
- [String Functions](#string-functions)
15+
- [Math Functions](#math-functions)
1516
- [Container Functions](#container-functions)
1617
- [Parser Functions](#parser-functions)
1718
- [Advanced Functions](#advanced-functions)
@@ -42,7 +43,7 @@ Goplater uses Go's [builtin templating library](https://pkg.go.dev/text/template
4243
**Example:**
4344

4445
```
45-
File Content: $​{​{​{ read "./myfile.txt" }​}​}
46+
File Content: +​{​{​{ read "./myfile.txt" }​}​}
4647
```
4748

4849
### File Functions
@@ -59,18 +60,16 @@ where relative paths are relative to the invoker.
5960
read "path"
6061
```
6162

62-
##### `readOpts`
63+
#### `readArgs`
6364

64-
Same as [`read`](#read) but with another parameter for additional arguments:
65-
66-
| Short | Long | Type | Note |
67-
| ----- | ------------- | ------ | --------------------------- |
68-
| `-r` | `--recursive` | `bool` | tries templating read files |
65+
Same as [`read`], but allows to supply additional arguments to the file for further processing.
6966

7067
```
71-
read "path" "--flag1" "--flag2"
68+
read "path" arg1 arg2 arg3
7269
```
7370

71+
Arguments are accessible in under `.args` with `{{{ index .args 0 }}}`.
72+
7473
#### `fetch`
7574

7675
Performs a get http request to the specified url.
@@ -245,6 +244,28 @@ Replaces substring via regex in string.
245244
regexReplace "string" "replace_regex" "replace_with"
246245
```
247246

247+
### Math Functions
248+
249+
#### `add`
250+
251+
Adds two numbers together.
252+
253+
#### `sub`
254+
255+
Subtraction for two numbers.
256+
257+
#### `mult`
258+
259+
Multiplies two numbers.
260+
261+
#### `divd`
262+
263+
Divides a through b.
264+
265+
#### `mod`
266+
267+
Performs a modulo b.
268+
248269
### Conversion Functions
249270

250271
Functions for converting types.
@@ -277,6 +298,10 @@ The following are functions for slices and maps.
277298

278299
Returns wether map or slice has key.
279300

301+
#### `includes`
302+
303+
Returns wether map or slice includes value.
304+
280305
#### `delete`
281306

282307
Deletes an entry from a map or slice.
@@ -470,7 +495,7 @@ Sets return output slice directly with **one slice**.
470495
returnOutputs slice
471496
```
472497

473-
##### `outputsGet`
498+
##### `getOutputs`
474499

475500
Returns the whole output slice.
476501

@@ -482,7 +507,7 @@ Calls a global function by its name (without passing any arguments).
482507
funcCall "name"
483508
```
484509

485-
Returns list of [`return`](#return) outputs in order of index.
510+
Returns list of [`return`](#return) outputs in order of index, or if applicable only a single output.
486511

487512
#### `funcCallArgs`
488513

0 commit comments

Comments
 (0)