Skip to content

Commit 91dd6bc

Browse files
authored
docs(readme): fix typo in CI rate limiting
Ahemm... Just meant to fix a typo but opening the readme showed a bunch of [linter warnings](https://github.com/DavidAnson/vscode-markdownlint) so one little change lead to another. As always, feel free to make edits or only accept some changes.
1 parent ee4c16c commit 91dd6bc

File tree

1 file changed

+40
-29
lines changed

1 file changed

+40
-29
lines changed

README.md

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ Add to your `gatsby-config.js` (all options are optional; defaults shown here):
7979
8080
Write code examples in your markdown file as usual:
8181
82-
```js
83-
this.willBe(highlighted);
84-
```
82+
````md
83+
```js
84+
this.willBe(highlighted);
85+
```
86+
````
8587
8688
## Dark mode support via `prefers-color-scheme`
8789
@@ -107,7 +109,8 @@ Generally, you probably don’t need or want to set all three `colorTheme` optio
107109
108110
The following can be used without specifying an extension to download from the marketplace:
109111
110-
#### Languages
112+
### Languages
113+
111114
<details>
112115
<summary>See all 55 languages</summary>
113116
@@ -166,11 +169,13 @@ The following can be used without specifying an extension to download from the m
166169
- XML
167170
- XML XSL
168171
- YAML
172+
169173
</details>
170174
171175
Language names are resolve case-insensitively by any aliases and file extensions listed in the grammar’s metadata. For example, a code fence with C++ code in it can use [any of these language codes](https://github.com/Microsoft/vscode/blob/da3c97f3668393ebfcb9f8208d7616018d6d1859/extensions/cpp/package.json#L20-L21). You could also check the [built-in grammar manifest](https://unpkg.com/gatsby-remark-vscode@1.0.3/lib/grammars/manifest.json) for an exact list of mappings.
172176
173-
#### Themes
177+
### Themes
178+
174179
Pro tip: a good way to preview themes is by flipping through them in VS Code. Here’s the list of included ones:
175180
176181
- Abyss
@@ -221,7 +226,7 @@ Next time you `gatsby develop` or `gatsby build`, the extension will be download
221226
222227
Anonymous requests to the Visual Studio Marketplace are rate limited, so if you’re downloading a lot of extensions or running builds in quick succession in an environment where the extensions aren’t already cached on disk (like on a build server), you might see failed requests.
223228
224-
As a workaround, you can set the `extensionDataDirectory` plugin option to an absolute path pointing to a folder that you check into source control. After running a build locally, any extensions you’ve requested will appear in that directory. Then, in CI, gatsby-remark-vscode will check that directory and determine if anything needs to be downloaded. By checking including the extensions alongside your own source code, you can avoid making requests to the Visual Studio Marketplace in CI entirely.
229+
As a workaround, you can set the `extensionDataDirectory` plugin option to an absolute path pointing to a folder that you check into source control. After running a build locally, any extensions you’ve requested will appear in that directory. Then, in CI, gatsby-remark-vscode will check that directory and determine if anything needs to be downloaded. By including the extensions alongside your own source code, you can avoid making requests to the Visual Studio Marketplace in CI entirely.
225230
226231
## Styles
227232
@@ -278,31 +283,35 @@ Since the CSS for token colors is auto-generated, it’s fragile and inconvenien
278283
279284
`gatsby-remark-vscode` offers the same line-range-after-language-name strategy of highlighting or emphasizing lines as [gatsby-remark-prismjs](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs):
280285
281-
```js{1,3-5}
282-
this.isLine(1); // highlighted
283-
this.isLine(2);
284-
this.isLine(3); // highlighted
285-
this.isLine(4); // highlighted
286-
this.isLine(5); // highlighted
287-
```
286+
````md
287+
```js{1,3-5}
288+
this.isLine(1); // highlighted
289+
this.isLine(2);
290+
this.isLine(3); // highlighted
291+
this.isLine(4); // highlighted
292+
this.isLine(5); // highlighted
293+
```
294+
````
288295
289296
Comment directives are also supported:
290297
291-
```js
292-
function constant(value) {
293-
return () => value; // highlight-line
294-
}
298+
````md
299+
```js
300+
function constant(value) {
301+
return () => value; // highlight-line
302+
}
295303

296-
// highlight-next-line
297-
const alwaysFour = constant(4);
304+
// highlight-next-line
305+
const alwaysFour = constant(4);
298306

299-
// highlight-start
300-
const zero = [0, 1, 2, 3, 4, 5]
301-
.map(alwaysFour)
302-
.filter(x => x !== 4)
303-
.length;
304-
// highlight-end
305-
```
307+
// highlight-start
308+
const zero = [0, 1, 2, 3, 4, 5]
309+
.map(alwaysFour)
310+
.filter(x => x !== 4)
311+
.length;
312+
// highlight-end
313+
```
314+
````
306315
307316
You need to pick your own background color, and optionally a left border width and color, for the highlighted lines. This can be done by setting CSS variables:
308317
@@ -331,9 +340,11 @@ The `colorTheme` option can take a function instead of a constant value. The fun
331340
332341
Line numbers and ranges aren’t the only things you can pass as options on your code fence. A JSON-like syntax is supported:
333342
334-
```jsx{theme: 'Monokai', someNumbers: {1,2,3}, nested: {objects: 'yep'}}
335-
<Amazing><Stuff /></Amazing>
336-
```
343+
````md
344+
```jsx{theme: 'Monokai', someNumbers: {1,2,3}, nested: {objects: 'yep'}}
345+
<Amazing><Stuff /></Amazing>
346+
```
347+
````
337348
338349
`gatsby-remark-vscode` doesn’t inherently understand these things, but it parses the input and allows you to access it in the `colorTheme`, `wrapperClassName` and `getLineClassName` functions:
339350

0 commit comments

Comments
 (0)