Skip to content

Commit d05be09

Browse files
fiskerlydell
authored andcommitted
Fix unpkg links in docs (prettier#6872)
1 parent 85912a7 commit d05be09

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@
362362
"unparenthesized",
363363
"unparseable",
364364
"unpause",
365+
"unpkg",
365366
"unrestrict",
366367
"untracked",
367368
"valourous",

docs/browser.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: browser
33
title: Browser
44
---
55

6-
Run Prettier in the browser with the `standalone.js` UMD bundle shipped in the NPM package (starting in version 1.13). The new UMD bundle only formats the code and has no support for config files, ignore files, CLI usage, or automatic loading of plugins.
6+
Run Prettier in the browser with the `standalone.js` UMD bundle shipped in the NPM package (starting in version 1.13). The UMD bundle only formats the code and has no support for config files, ignore files, CLI usage, or automatic loading of plugins.
77

88
### `prettier.format(code, options)`
99

@@ -15,12 +15,14 @@ See [Usage](#usage) below for examples.
1515

1616
### Global
1717

18-
<!-- prettier-ignore -->
1918
```html
20-
<script src="https://unpkg.com/[email protected]/standalone.js"></script>
21-
<script src="https://unpkg.com/[email protected]/parser-graphql.js"></script>
22-
<script type="text/javascript">
23-
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
19+
<script src="https://unpkg.com/[email protected]/standalone.js"></script>
20+
<script src="https://unpkg.com/[email protected]/parser-graphql.js"></script>
21+
<script>
22+
prettier.format("query { }", {
23+
parser: "graphql",
24+
plugins: prettierPlugins
25+
});
2426
</script>
2527
```
2628

@@ -40,8 +42,8 @@ prettier.format("query { }", {
4042

4143
```js
4244
define([
43-
"https://unpkg.com/prettier@1.13.0/standalone.js",
44-
"https://unpkg.com/prettier@1.13.0/parser-graphql.js"
45+
"https://unpkg.com/prettier@1.18.2/standalone.js",
46+
"https://unpkg.com/prettier@1.18.2/parser-graphql.js"
4547
], (prettier, ...plugins) => {
4648
prettier.format("query { }", { parser: "graphql", plugins });
4749
});
@@ -60,7 +62,7 @@ This syntax doesn't necessarily work in the browser, but it can be used when bun
6062
### Worker
6163

6264
```js
63-
importScripts("https://unpkg.com/prettier@1.13.0/standalone.js");
64-
importScripts("https://unpkg.com/prettier@1.13.0/parser-graphql.js");
65+
importScripts("https://unpkg.com/prettier@1.18.2/standalone.js");
66+
importScripts("https://unpkg.com/prettier@1.18.2/parser-graphql.js");
6567
prettier.format("query { }", { parser: "graphql", plugins: prettierPlugins });
6668
```

scripts/release/steps/update-version.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ async function bump({ version }) {
1616
content.replace(/^(- Prettier Version: ).*?$/m, `$1${version}`)
1717
);
1818

19+
// Update unpkg link in docs
20+
processFile("docs/browser.md", content =>
21+
content.replace(/(\/\/unpkg\.com\/prettier@)(?:.*?)\//g, `$1${version}/`)
22+
);
23+
1924
await execa("yarn", ["update-stable-docs"], {
2025
cwd: "./website"
2126
});

0 commit comments

Comments
 (0)