diff --git a/packages/escape/1.0.2/LICENSE b/packages/escape/1.0.2/LICENSE new file mode 100644 index 00000000..7b29b162 --- /dev/null +++ b/packages/escape/1.0.2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Dickson Law + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/escape/1.0.2/README.md b/packages/escape/1.0.2/README.md new file mode 100755 index 00000000..f338b04d --- /dev/null +++ b/packages/escape/1.0.2/README.md @@ -0,0 +1,37 @@ +# Escape Text + +A simple Espanso package for encoding and decoding various common escape formats in programming (JSON, XML, URL-encoding, regular expressions) + +## Requirements + +- Python 3.x +- Espanso 2.x or higher + +## Installation + +``` +espanso install escape +``` + +## Usage + +### Encoding + +All encoding triggers start with `>>` + +| Trigger | Conversion | +|-----------|---------| +| `>>json` | Text -> JSON/backslash | +| `>>xml` | Text -> XML | +| `>>url` | Text -> URL encoding | +| `>>regex` | Text -> Regular expression literal | + +### Decoding + +All decoding triggers start with `<<` + +| Trigger | Conversion | +|-----------|---------| +| `< Text | +| `< Text | +| `< Text | diff --git a/packages/escape/1.0.2/_manifest.yml b/packages/escape/1.0.2/_manifest.yml new file mode 100755 index 00000000..7fa9348a --- /dev/null +++ b/packages/escape/1.0.2/_manifest.yml @@ -0,0 +1,7 @@ +author: Dickson Law +description: Common character escapes (backslashing, JSON, XML, URL-encoding, regex) +title: Escape Text +name: escape +homepage: https://github.com/dicksonlaw583/espanso-escape +version: 1.0.2 +tags: ["json", "xml", "backslash", "url encoding", "x-www-form-urlencoded", "escape"] \ No newline at end of file diff --git a/packages/escape/1.0.2/_pkgsource.yml b/packages/escape/1.0.2/_pkgsource.yml new file mode 100644 index 00000000..0aa8f31d --- /dev/null +++ b/packages/escape/1.0.2/_pkgsource.yml @@ -0,0 +1,2 @@ +--- +hub diff --git a/packages/escape/1.0.2/jsonescape.py b/packages/escape/1.0.2/jsonescape.py new file mode 100755 index 00000000..3653759a --- /dev/null +++ b/packages/escape/1.0.2/jsonescape.py @@ -0,0 +1,6 @@ +import sys +from json import dumps as escape + +if __name__ == '__main__': + sys.stdout.reconfigure(encoding='utf-8') + print(escape(sys.argv[1])[1:-1], end='') diff --git a/packages/escape/1.0.2/jsonunescape.py b/packages/escape/1.0.2/jsonunescape.py new file mode 100755 index 00000000..39e1aad4 --- /dev/null +++ b/packages/escape/1.0.2/jsonunescape.py @@ -0,0 +1,6 @@ +import sys +from json import loads as unescape + +if __name__ == '__main__': + sys.stdout.reconfigure(encoding='utf-8') + print(unescape('"%s"' % (sys.argv[1])), end='') diff --git a/packages/escape/1.0.2/package.yml b/packages/escape/1.0.2/package.yml new file mode 100755 index 00000000..6e36d48e --- /dev/null +++ b/packages/escape/1.0.2/package.yml @@ -0,0 +1,133 @@ +global_vars: + - name: escape_python + type: echo + params: + echo: "python" # Replace this with the path to your Python instance if automatic detection is failing + +matches: + - triggers: [">>json", ">>\\"] + replace: "{{stdout}}" + vars: + - name: "f" + type: form + params: + layout: "JSON/backslash escape\n\nText:\n[[text]]" + fields: + text: + multiline: true + - name: stdout + type: script + params: + trim: false + args: + - "{{escape_python}}" + - "%CONFIG%/match/packages/escape/jsonescape.py" + - "{{f.text}}" + - triggers: ["<>xml" + replace: "{{stdout}}" + vars: + - name: "f" + type: form + params: + layout: "XML escape\n\nText:\n[[text]]" + fields: + text: + multiline: true + - name: stdout + type: script + params: + trim: false + args: + - "{{escape_python}}" + - "%CONFIG%/match/packages/escape/xmlescape.py" + - "{{f.text}}" + - trigger: "<>url" + replace: "{{stdout}}" + vars: + - name: "f" + type: form + params: + layout: "URL encode\n\nText:\n[[text]]" + fields: + text: + multiline: true + - name: stdout + type: script + params: + trim: false + args: + - "{{escape_python}}" + - "%CONFIG%/match/packages/escape/urlescape.py" + - "{{f.text}}" + - trigger: "<>regex" + replace: "{{stdout}}" + vars: + - name: "f" + type: form + params: + layout: "Regex escape\n\nText:\n[[text]]" + fields: + text: + multiline: true + - name: stdout + type: script + params: + trim: false + args: + - "{{escape_python}}" + - "%CONFIG%/match/packages/escape/regexescape.py" + - "{{f.text}}" \ No newline at end of file diff --git a/packages/escape/1.0.2/regexescape.py b/packages/escape/1.0.2/regexescape.py new file mode 100755 index 00000000..9f63d0b5 --- /dev/null +++ b/packages/escape/1.0.2/regexescape.py @@ -0,0 +1,6 @@ +import sys +from re import escape + +if __name__ == '__main__': + sys.stdout.reconfigure(encoding='utf-8') + print(escape(sys.argv[1]), end='') diff --git a/packages/escape/1.0.2/urlescape.py b/packages/escape/1.0.2/urlescape.py new file mode 100755 index 00000000..d846d8d3 --- /dev/null +++ b/packages/escape/1.0.2/urlescape.py @@ -0,0 +1,6 @@ +import sys +from urllib.parse import quote_plus as escape + +if __name__ == '__main__': + sys.stdout.reconfigure(encoding='utf-8') + print(escape(sys.argv[1]), end='') diff --git a/packages/escape/1.0.2/urlunescape.py b/packages/escape/1.0.2/urlunescape.py new file mode 100755 index 00000000..31dc1bfe --- /dev/null +++ b/packages/escape/1.0.2/urlunescape.py @@ -0,0 +1,6 @@ +import sys +from urllib.parse import unquote_plus as unescape + +if __name__ == '__main__': + sys.stdout.reconfigure(encoding='utf-8') + print(unescape(sys.argv[1]), end='') diff --git a/packages/escape/1.0.2/xmlescape.py b/packages/escape/1.0.2/xmlescape.py new file mode 100755 index 00000000..bbfb310e --- /dev/null +++ b/packages/escape/1.0.2/xmlescape.py @@ -0,0 +1,6 @@ +import sys +from xml.sax.saxutils import escape + +if __name__ == '__main__': + sys.stdout.reconfigure(encoding='utf-8') + print(escape(sys.argv[1]), end='') diff --git a/packages/escape/1.0.2/xmlunescape.py b/packages/escape/1.0.2/xmlunescape.py new file mode 100755 index 00000000..3ed87615 --- /dev/null +++ b/packages/escape/1.0.2/xmlunescape.py @@ -0,0 +1,6 @@ +import sys +from xml.sax.saxutils import unescape + +if __name__ == '__main__': + sys.stdout.reconfigure(encoding='utf-8') + print(unescape(sys.argv[1]), end='') diff --git a/packages/repeat/1.0.2/LICENSE b/packages/repeat/1.0.2/LICENSE new file mode 100644 index 00000000..7b29b162 --- /dev/null +++ b/packages/repeat/1.0.2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Dickson Law + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/repeat/1.0.2/README.md b/packages/repeat/1.0.2/README.md new file mode 100644 index 00000000..0bc479a3 --- /dev/null +++ b/packages/repeat/1.0.2/README.md @@ -0,0 +1,22 @@ +# Repeat + +A simple package for typing a piece of text on repeat. + +## Requirements + +- Espanso 2.x or higher +- Python 3.x + +## Installation + +``` +espanso install repeat +``` + +## Triggers + +| Trigger | Description | +|-----------|---------| +| `;rep` (first character is a semicolon `;`) | Repeat a piece of text N times. | +| `:rep` (first character is a colon `:`) | Repeat a text template over each row of a list of items. | +| `^rep` | Repeat a text template over each row of a list of items (with customizable separators and support for row columns). | diff --git a/packages/repeat/1.0.2/_manifest.yml b/packages/repeat/1.0.2/_manifest.yml new file mode 100644 index 00000000..113b8cf3 --- /dev/null +++ b/packages/repeat/1.0.2/_manifest.yml @@ -0,0 +1,7 @@ +author: Dickson Law +description: Utility for typing text on repeat. +title: Repeat +name: repeat +homepage: https://github.com/dicksonlaw583/espanso-repeat +version: 1.0.2 +tags: ["repeat", "repetition", "repetitive"] \ No newline at end of file diff --git a/packages/repeat/1.0.2/_pkgsource.yml b/packages/repeat/1.0.2/_pkgsource.yml new file mode 100644 index 00000000..0aa8f31d --- /dev/null +++ b/packages/repeat/1.0.2/_pkgsource.yml @@ -0,0 +1,2 @@ +--- +hub diff --git a/packages/repeat/1.0.2/foreach.py b/packages/repeat/1.0.2/foreach.py new file mode 100644 index 00000000..658485f8 --- /dev/null +++ b/packages/repeat/1.0.2/foreach.py @@ -0,0 +1,10 @@ +import sys, json + +if __name__ == '__main__': + # Syntax: foreach.py