Skip to content

Commit 5458ed3

Browse files
README: Fix syntax highlighting (#945)
All JSON is YAML, but no the other way around. Co-authored-by: Muthurajan Sivasubramanian <[email protected]>
1 parent d354c58 commit 5458ed3

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The following settings are supported:
5858

5959
In order to use the custom tags in your YAML file you need to first specify the custom tags in the setting of your code editor. For example, we can have the following custom tags:
6060

61-
```YAML
61+
```yaml
6262
"yaml.customTags": [
6363
"!Scalar-example scalar",
6464
"!Seq-example sequence",
@@ -70,7 +70,7 @@ The !Scalar-example would map to a scalar custom tag, the !Seq-example would map
7070

7171
We can then use the newly defined custom tags inside our YAML file:
7272

73-
```YAML
73+
```yaml
7474
some_key: !Scalar-example some_value
7575
some_sequence: !Seq-example
7676
- some_seq_key_1: some_seq_value_1
@@ -93,7 +93,7 @@ myProject
9393
9494
you can do
9595
96-
```
96+
```yaml
9797
yaml.schemas: {
9898
"https://json.schemastore.org/composer": "/myYamlFile.yaml"
9999
}
@@ -109,7 +109,7 @@ and that will associate the composer schema with myYamlFile.yaml.
109109

110110
When associating a schema it should follow the format below
111111

112-
```json
112+
```yaml
113113
yaml.schemas: {
114114
"url": "globPattern",
115115
"Kubernetes": "globPattern"
@@ -118,23 +118,23 @@ yaml.schemas: {
118118

119119
e.g.
120120

121-
```json
121+
```yaml
122122
yaml.schemas: {
123123
"https://json.schemastore.org/composer": "/*"
124124
}
125125
```
126126

127127
e.g.
128128

129-
```json
129+
```yaml
130130
yaml.schemas: {
131131
"kubernetes": "/myYamlFile.yaml"
132132
}
133133
```
134134

135135
e.g.
136136

137-
```json
137+
```yaml
138138
yaml.schemas: {
139139
"https://json.schemastore.org/composer": "/*",
140140
"kubernetes": "/myYamlFile.yaml"
@@ -143,37 +143,37 @@ yaml.schemas: {
143143

144144
On Windows with full path:
145145

146-
```json
146+
```yaml
147147
yaml.schemas: {
148148
"C:\\Users\\user\\Documents\\custom_schema.json": "someFilePattern.yaml",
149149
}
150150
```
151151

152152
On Mac/Linux with full path:
153153

154-
```json
154+
```yaml
155155
yaml.schemas: {
156156
"/home/user/custom_schema.json": "someFilePattern.yaml",
157157
}
158158
```
159159

160160
Since `0.11.0` YAML Schemas can be used for validation:
161161

162-
```json
162+
```yaml
163163
"/home/user/custom_schema.yaml": "someFilePattern.yaml"
164164
```
165165
166166
A schema can be associated with multiple globs using a json array, e.g.
167167
168-
```json
168+
```yaml
169169
yaml.schemas: {
170170
"kubernetes": ["filePattern1.yaml", "filePattern2.yaml"]
171171
}
172172
```
173173

174174
e.g.
175175

176-
```json
176+
```yaml
177177
"yaml.schemas": {
178178
"http://json.schemastore.org/composer": ["/*"],
179179
"file:///home/johnd/some-schema.json": ["some.yaml"],
@@ -184,15 +184,15 @@ e.g.
184184

185185
e.g.
186186

187-
```json
187+
```yaml
188188
"yaml.schemas": {
189189
"kubernetes": ["/myYamlFile.yaml"]
190190
}
191191
```
192192

193193
e.g.
194194

195-
```json
195+
```yaml
196196
"yaml.schemas": {
197197
"http://json.schemastore.org/composer": ["/*"],
198198
"kubernetes": ["/myYamlFile.yaml"]
@@ -205,7 +205,7 @@ You can also use relative paths when working with multi root workspaces.
205205

206206
Suppose you have a multi root workspace that is laid out like:
207207

208-
```
208+
```yaml
209209
My_first_project:
210210
test.yaml
211211
my_schema.json
@@ -216,7 +216,7 @@ My_second_project:
216216
217217
You must then associate schemas relative to the root of the multi root workspace project.
218218
219-
```
219+
```yaml
220220
yaml.schemas: {
221221
"My_first_project/my_schema.json": "test.yaml",
222222
"My_second_project/my_schema2.json": "test2.yaml"
@@ -229,7 +229,7 @@ yaml.schemas: {
229229

230230
Suppose a file is meant to be a component of an existing schema (like a `job.yaml` file in a circleci orb), but there isn't a standalone schema that you can reference. If there is a nested schema definition for this subcomponent, you can reference it using a url fragment, e.g.:
231231

232-
```
232+
```yaml
233233
yaml.schemas: {
234234
"https://json.schemastore.org/circleciconfig#/definitions/jobs/additionalProperties": "/src/jobs/*.yaml",
235235
}
@@ -275,7 +275,7 @@ The image is located at `quay.io/redhat-developer/yaml-language-server`
275275

276276
To run the image you can use:
277277

278-
```
278+
```sh
279279
docker run -it quay.io/redhat-developer/yaml-language-server:latest
280280
```
281281

0 commit comments

Comments
 (0)