Skip to content

Commit 218948d

Browse files
committed
Update top-level await in readmes
1 parent ee0970f commit 218948d

File tree

4 files changed

+42
-59
lines changed

4 files changed

+42
-59
lines changed

packages/rehype-katex/readme.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,16 @@ import rehypeKatex from 'rehype-katex'
9696
import rehypeDocument from 'rehype-document'
9797
import rehypeStringify from 'rehype-stringify'
9898

99-
main()
100-
101-
async function main() {
102-
const file = await unified()
103-
.use(rehypeParse, {fragment: true})
104-
.use(rehypeKatex)
105-
.use(rehypeDocument, {
106-
css: 'https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css'
107-
})
108-
.use(rehypeStringify)
109-
.process(await read('example.html'))
110-
111-
console.log(String(file))
112-
}
99+
const file = await unified()
100+
.use(rehypeParse, {fragment: true})
101+
.use(rehypeKatex)
102+
.use(rehypeDocument, {
103+
css: 'https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css'
104+
})
105+
.use(rehypeStringify)
106+
.process(await read('example.html'))
107+
108+
console.log(String(file))
113109
```
114110

115111
Now running `node example.js` yields:

packages/rehype-mathjax/readme.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,13 @@ import rehypeParse from 'rehype-parse'
9595
import rehypeMathjax from 'rehype-mathjax'
9696
import rehypeStringify from 'rehype-stringify'
9797

98-
main()
99-
100-
async function main() {
101-
const file = await unified()
102-
.use(rehypeParse, {fragment: true})
103-
.use(rehypeMathjax)
104-
.use(rehypeStringify)
105-
.process(await read('example.html'))
98+
const file = await unified()
99+
.use(rehypeParse, {fragment: true})
100+
.use(rehypeMathjax)
101+
.use(rehypeStringify)
102+
.process(await read('example.html'))
106103

107-
console.log(String(file))
108-
}
104+
console.log(String(file))
109105
```
110106

111107
Now running `node example.js` yields:

packages/remark-math/readme.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,15 @@ import remarkRehype from 'remark-rehype'
9696
import rehypeKatex from 'rehype-katex'
9797
import rehypeStringify from 'rehype-stringify'
9898

99-
main()
100-
101-
async function main() {
102-
const file = await unified()
103-
.use(remarkParse)
104-
.use(remarkMath)
105-
.use(remarkRehype)
106-
.use(rehypeKatex)
107-
.use(rehypeStringify)
108-
.process(await read('example.md'))
109-
110-
console.log(String(file))
111-
}
99+
const file = await unified()
100+
.use(remarkParse)
101+
.use(remarkMath)
102+
.use(remarkRehype)
103+
.use(rehypeKatex)
104+
.use(rehypeStringify)
105+
.process(await read('example.md'))
106+
107+
console.log(String(file))
112108
```
113109

114110
Now running `node example.js` yields:

readme.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,15 @@ import remarkRehype from 'remark-rehype'
8181
import rehypeKatex from 'rehype-katex'
8282
import rehypeStringify from 'rehype-stringify'
8383

84-
main()
85-
86-
async function main() {
87-
const file = await unified()
88-
.use(remarkParse)
89-
.use(remarkMath)
90-
.use(remarkRehype)
91-
.use(rehypeKatex)
92-
.use(rehypeStringify)
93-
.process(await read('example.md'))
94-
95-
console.log(String(file))
96-
}
84+
const file = await unified()
85+
.use(remarkParse)
86+
.use(remarkMath)
87+
.use(remarkRehype)
88+
.use(rehypeKatex)
89+
.use(rehypeStringify)
90+
.process(await read('example.md'))
91+
92+
console.log(String(file))
9793
```
9894

9995
Now running `node example.js` yields:
@@ -130,15 +126,14 @@ Take the above KaTeX example and change:
130126
+import rehypeMathjax from 'rehype-mathjax'
131127
import rehypeStringify from 'rehype-stringify'
132128
133-
main()
134-
@@ -13,7 +13,7 @@ async function main() {
135-
.use(remarkParse)
136-
.use(remarkMath)
137-
.use(remarkRehype)
138-
- .use(rehypeKatex)
139-
+ .use(rehypeMathjax)
140-
.use(rehypeStringify)
141-
.process(await read('example.md'))
129+
@@ -13,7 +13,7 @@
130+
.use(remarkParse)
131+
.use(remarkMath)
132+
.use(remarkRehype)
133+
- .use(rehypeKatex)
134+
+ .use(rehypeMathjax)
135+
.use(rehypeStringify)
136+
.process(await read('example.md'))
142137
```
143138
144139
Now running `node example.js` yields:

0 commit comments

Comments
 (0)