-
Notifications
You must be signed in to change notification settings - Fork 2
/
espanso-schema-backup.json
200 lines (200 loc) · 6.04 KB
/
espanso-schema-backup.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://ajm.codes/espanso-schema.json",
"title": "Espanso → text expander schema",
"description": "The Schema for text expansions for the open source program Espanso (see https://Espanso.org)",
"type": "object",
"properties": {
"trigger": {
"description": "An array with at least one item, this is the text you type in order to trigger Espanso's text replacement. One expansion may have many triggers, although usually just one is used. (See https://espanso.org/docs/matches/basics/ or https://espanso.org/docs/matches/basics/#multiple-triggers)",
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"minItems": 1,
"error": "A text trigger must be at least one character. There must be at least one text trigger."
},
"regex": {
"description": "This is a string field to trigger the text replacement, desribing a regex, which, when matched, triggers Espanso's text replacement. An alternate to trigger. Follows the syntax defined in Espanso docs. (See https://espanso.org/docs/matches/regex-triggers/)",
"type": "string"
},
"label": {
"description": "A string field to override the default description of a text replacement, making searching for your snippet easier. (See https://espanso.org/docs/matches/basics/#search-labels)",
"type": "array",
"minItems": 0,
"maxItems": 1,
"items": {
"type": "string",
"minLength": 1
}
},
"word": {
"description": "A boolean field turning on and off setting that tells Espanso to only trigger that match if surrounded by word separators, such as spaces, commas and newlines. Useful for spell checking. (See https://espanso.org/docs/matches/basics/#word-triggers) ",
"type": "boolean"
},
"image_path": {
"description": "A string field that specifies a path to an image, which the text trigger will be replaced with, instead of text. (See https://espanso.org/docs/matches/basics/#image-matches)",
"type": "string"
},
"propagate_case": {
"description": "A boolean field turning on and off case-propagation, which makes it possible to expand a match preserving the trigger casing. (See https://espanso.org/docs/matches/basics/#case-propagation)",
"type": "boolean"
},
"replace": {
"description": "A string match that defines the text that will expand at every occurrence of the trigger. (See https://espanso.org/docs/matches/basics/#static-matches)",
"type": "string"
},
"form": {
"description": "An expansion which renders a form the user fills out in order for expansion to complete. A form must have at least one user-fillable fields denoted by double-brackets [[field_name]] syntax. (See https://espanso.org/docs/matches/forms/ )",
"type": "string",
"pattern": "(\\[\\[([a-zA-Z0-9]{1,25})\\]\\])+$"
},
"vars": {
"type": "array",
"items": {
"type": "object",
"description": "Variables have the capability to include the result of extensions within a match, but they can also be used to generate more complex text expansions.",
"required": [
"variable_type",
"params",
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The name within your text expansion definition to use your variable data.This variable should be named without double brackets, e.g., my_special_variable. In use, surround with {{ }} on either side of variable.",
"minLength": 1
},
"variable_type": {
"type": "string",
"description": "In Espanso docs this is called the extensions system. This type field defines how the data for the variable is gathered. (See https://espanso.org/docs/matches/extensions/) ",
"enum": [
"clipboard",
"choice",
"date",
"echo",
"form",
"random",
"script",
"shell"
]
},
"params": {
"type": "object",
"properties": {
"placeholder": {
"type": "string"
},
"params": {
"$ref": "#/properties/vars/items"
}
}
},
"additionalProperties": false
},
"additionalProperties": false
},
"minItems": 0
}
},
"allOf": [
{
"oneOf": [
{
"type": "object",
"required": [
"trigger"
]
},
{
"type": "object",
"required": [
"regex"
]
}
]
},
{
"oneOf": [
{
"type": "object",
"required": [
"replace"
]
},
{
"type": "object",
"properties": {},
"required": [
"image_path"
]
},
{
"type": "object",
"required": [
"form"
]
}
]
},
{
"if": {
"properties": {
"image_path": {
"type": "string"
}
},
"required": [
"image_path"
]
},
"then": {
"not": {
"required": [
"propagate_case"
]
}
}
},
{
"if": {
"properties": {
"image_path": {
"type": "string"
}
},
"required": [
"image_path"
]
},
"then": {
"not": {
"required": [
"word"
]
}
}
},
{
"if": {
"properties": {
"image_path": {
"type": "string"
}
},
"required": [
"image_path"
]
},
"then": {
"not": {
"required": [
"vars"
]
}
}
}
],
"additionalProperties": false
}