Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new package added: verbose-form-template #85

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions packages/espanso-dropdown-list-template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Espanso: Dropdown List Template

## Description

Enhance your text expansion capabilities with the "Espanso: Dropdown List Template" shortcut. It provides a structured and modular way to create dynamic text replacements. Specify key parameters, including form name, trigger, variable, replace, and your own custom list options, making your replacements versatile and adaptable.


## Usage

### Trigger Phrase

Activate the shortcut using the trigger phrase: `espanso-dropdown-list-template`

### Form Input

Upon activation, fill out the form with the following options:

* **Form Name**: Your chosen name for the form.
* **Trigger**: Define the trigger phrase for the replacement.
* **Variable**: Specify a placeholder variable.
* **Replace**: Enter the replacement text with `{{FORM.variable}}` for dynamic content.
* **Custom List Options**: Define three custom list options of your choosing.

### Example Usage

* [/Users/omarmenawi/Library/Application Support/espanso/match/Espanso/espanso-dropdown-list-template/espanso-dropdown-demo.mov](/Users/omarmenawi/Library/Application Support/espanso/match/Espanso/espanso-dropdown-list-template/espanso-dropdown-demo.mov)

## Installation


1. Make sure you have [Espanso](https://espanso.org/) installed on your system.
2. Download the `espanso-dropdown-list-template.yml` file from this repository.
3. Place the downloaded YAML file in your Espanso configuration directory, typically located at `~/.config/espanso/` on Linux or `%APPDATA%\espanso` on Windows.
smeech marked this conversation as resolved.
Show resolved Hide resolved
4. Restart Espanso to apply the changes.

## Author

Created by Omar Elmenawi

## License

This Espanso shortcut is available under the [MIT License](LICENSE).


7 changes: 7 additions & 0 deletions packages/espanso-dropdown-list-template/_manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: espanso-dropdown-list-template
version: 1.0.0
author: Omar Elmenawi
description: Espanso shortcut for creating structured and modular text replacements with custom list options.
repository: https://github.com/menawi/espanso-dropdown-list-template


Copy link
Collaborator

@smeech smeech May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tags: would be helpful, and repository: changed to homepage:.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tags and removed repository so the package is more in line with other submissions

smeech marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
smeech marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
matches:

- triggers: ['$colors$']
smeech marked this conversation as resolved.
Show resolved Hide resolved
replace: "color: {{CSS.color_name}}"
vars:
- name: "CSS"
type: form
params:
layout: "color_name: [[color_name]]"
fields:
color_name:
type: list
values:
- darkred
- limegreen
- royalblue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the file that needs renaming to package.yml.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed. I also renamed the entire package so it better reflects the espanso verbose extension it uses

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
matches:

- triggers: ['dropdown..']
replace: "\u0020\u0020-\u0020triggers:\u0020['{{FORM.trigger}}']\n\u0020\u0020\u0020\u0020replace:\u0020\"{{FORM.replace}}\u0020{{{{FORM.form_name}}.{{FORM.variable}}}}\"\n\u0020\u0020\u0020\u0020vars:\n\u0020\u0020\u0020\u0020\u0020\u0020-\u0020name:\u0020\"{{FORM.form_name}}\"\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020type:\u0020form\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020params:\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020layout:\u0020\"{{FORM.variable}}:\u0020[[{{FORM.variable}}]]\"\u0020\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020fields:\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020{{FORM.variable}}:\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020type:\u0020list\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020values:\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020-\u0020{{FORM.list_option_one}}\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020-\u0020{{FORM.list_option_two}}\n\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020-\u0020{{FORM.list_option_three}}"
vars:
- name: "FORM"
type: form
params:
layout: "Form_Name: [[form_name]] Form_Trigger: [[trigger]] Form_Replace: [[replace]] Form_Variable: [[variable]] Form_List_Option_One: [[list_option_one]] Form_List_Option_Two: [[list_option_two]] Form_List_Option_Three: [[list_option_three]]"
fields:
form_name:
trigger:
variable:
replace:
var_type:
list_option_one:
label: "Espanso: Form - Verbose"
description: |
- Allows you to specify :
- form name
- trigger
- variable
- replace
- three starter list options