Document interaction of CLI & package script

This commit is contained in:
Katrin Leinweber 2021-06-22 17:55:06 +02:00
parent 066a25a96e
commit 9ebb526ef9
2 changed files with 32 additions and 1 deletions

View File

@ -41,4 +41,15 @@ espanso match exec <trigger>
where `<trigger>` is the match trigger.
This is useful if, for example, you want to trigger an expansion from a script.
This is useful if, for example, you want to trigger an expansion from a script.
### Paths
Besides the [overview command](configuration#structure) `espanso path`,
you can also output the exact paths to specific components:
```
espanso path packages # or config, data or default
```
This is useful for including [scripts in packages](packages#scripts-in-packages).

View File

@ -109,6 +109,26 @@ allowed)
replace: "hello world"
```
### Scripts in packages
[Script Extension](matches#script-extension) can also be added to packages.
Use a combination of the [CLI](cli#paths)'s `espanso path packages` output
and your package's name to automatically construct the correct path:
{% raw %}
```yaml
- trigger: ":pyscript"
replace: "{{output}}"
vars:
- name: output
type: script
params:
args:
- python
- "$(espanso path packages)/simple-package/scripts/script.py"
```
{% endraw %}
#### Publishing on espanso hub
After following all these steps, you can request to publish your package to [espanso hub](http://hub.espanso.org)