File tree Expand file tree Collapse file tree 4 files changed +42
-59
lines changed Expand file tree Collapse file tree 4 files changed +42
-59
lines changed Original file line number Diff line number Diff line change @@ -96,20 +96,16 @@ import rehypeKatex from 'rehype-katex'
96
96
import rehypeDocument from ' rehype-document'
97
97
import rehypeStringify from ' rehype-stringify'
98
98
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))
113
109
```
114
110
115
111
Now running ` node example.js ` yields:
Original file line number Diff line number Diff line change @@ -95,17 +95,13 @@ import rehypeParse from 'rehype-parse'
95
95
import rehypeMathjax from ' rehype-mathjax'
96
96
import rehypeStringify from ' rehype-stringify'
97
97
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' ))
106
103
107
- console .log (String (file))
108
- }
104
+ console .log (String (file))
109
105
```
110
106
111
107
Now running ` node example.js ` yields:
Original file line number Diff line number Diff line change @@ -96,19 +96,15 @@ import remarkRehype from 'remark-rehype'
96
96
import rehypeKatex from ' rehype-katex'
97
97
import rehypeStringify from ' rehype-stringify'
98
98
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))
112
108
```
113
109
114
110
Now running ` node example.js ` yields:
Original file line number Diff line number Diff line change @@ -81,19 +81,15 @@ import remarkRehype from 'remark-rehype'
81
81
import rehypeKatex from ' rehype-katex'
82
82
import rehypeStringify from ' rehype-stringify'
83
83
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))
97
93
```
98
94
99
95
Now running ` node example.js ` yields:
@@ -130,15 +126,14 @@ Take the above KaTeX example and change:
130
126
+import rehypeMathjax from 'rehype-mathjax'
131
127
import rehypeStringify from 'rehype-stringify'
132
128
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'))
142
137
```
143
138
144
139
Now running ` node example.js ` yields:
You can’t perform that action at this time.
0 commit comments