Skip to content

Automation of Recurring Text Entries

madbkr edited this page Oct 8, 2024 · 4 revisions

Development and especially documentation sometimes require to do recurring, tedious tasks.
Automation can easen the process by inserting text snippets triggered by keywords.

Example

Inserting the URLs for the term tracker annotation is a good example.
The keyword is ;oeo-tta in this example. So whenever you type the keyword it will be replaced by a text you defined beforehand.

Example.automatic.term-tracker.composition.webm

Description

This functionality is based on a so-called text expander. There are plenty software solutions existent.
A open-source, plattform-independent program is Espanso by Frederico Terzi which is very easy to configure.

It can either be installed on the system or be run as a portable programm, see https://espanso.org/install/.

The text snippets are triggered by matching keywords which are specified in a file called base.yml.
This file is located in the match-d

irectory of the program's directory: %YourInstallationDirectory%\Espanso\.espanso\match\base.yml

Templates for this Project

For this project you can use the matches. Simply copy and paste these into your match\base.yml-file.

It is recommenable to prefix every keyword with a certain character, so that unintended triggers are prevented.
A semi-colon ; is a good choice as this is used rarely without a trailing whitespace in natural-language.
The symbol is supported in all environments, even the shell/command-line.

Quick-Tip 🔎: There are far more advanced uses of Espanso. For these, please refer to the offical documentation.

Snippet: term tracker annotation

This snippets saves you copy-pasting / writing the GitHub-URLs.
In the short form you can enter the purpose of your change, the related issue and pr.

  - trigger: ";oeo-tta"
    form: |
      [[purpose]]
      issue: https://github.com/OpenEnergyPlatform/ontology/issues/[[issueNumber]]
      pull request: https://github.com/OpenEnergyPlatform/ontology/pull/[[PRnumber]]
Clone this wiki locally