Skip to content

Commit 081326d

Browse files
committed
docs: update documentation for VALUE variable in QuickAdd API
1 parent e7ac211 commit 081326d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/docs/FormatSyntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Format syntax
77
| `{{DATE}}` | Outputs the current date in `YYYY-MM-DD` format. You could write `{{DATE+3}}` to offset the date with 3 days. You can use `+-3` to offset with `-3` days. |
88
| `{{DATE:<DATEFORMAT>}}` | Replace `<DATEFORMAT>` with a [Moment.js date format](https://momentjs.com/docs/#/displaying/format/). You could write `{{DATE<DATEFORMAT>+3}}` to offset the date with 3 days. |
99
| `{{VDATE:<variable name>, <date format>}}` | You'll get prompted to enter a date and it'll be parsed to the given date format. You could write 'today' or 'in two weeks' and it'll give you the date for that. Works like variables, so you can use the date in multiple places. **REQUIRES THE NATURAL LANGUAGE DATES PLUGIN!** |
10-
| `{{VALUE}}` or `{{NAME}}` | Interchangeable. Represents the value given in an input prompt. If text is selected in the current editor, it will be used as the value. |
10+
| `{{VALUE}}` or `{{NAME}}` | Interchangeable. Represents the value given in an input prompt. If text is selected in the current editor, it will be used as the value. When using the QuickAdd API, this can be passed programmatically using the reserved variable name 'value'. |
1111
| `{{VALUE:<variable name>}}` | You can now use variable names in values. They'll get saved and inserted just like values, but the difference is that you can have as many of them as you want. Use comma separation to get a suggester rather than a prompt. |
1212
| `{{LINKCURRENT}}` | A link to the file from which the template is activated from. `[[link]]` format. |
1313
| `{{MACRO:<MACRONAME>}}` | Execute a macro and write the return value here. |

docs/docs/QuickAddAPI.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ massiveDataArray.forEach(async (data) => {
8080

8181
This would execute the choice for each item in the array, passing the data as a variable. This means you can access the variables from within your Capture with `{{VALUE:X}}` (and so on, for each key-value pair in the object).
8282

83+
Additionally, you can use the reserved variable name 'value' to pass a value directly to `{{VALUE}}` or `{{NAME}}` format tags:
84+
85+
```js
86+
await params.quickAddApi.executeChoice('My Template Choice', {
87+
value: "This text will be used for {{VALUE}} tags",
88+
customVar: "This will be available as {{VALUE:customVar}}"
89+
});
90+
```
91+
8392
## Utility module
8493
Given by `api.utility`.
8594

0 commit comments

Comments
 (0)