-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreview.js
30 lines (29 loc) · 846 Bytes
/
preview.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import init from 'previewed';
import markdown from '@previewed/plugin-markdown-it';
import MarkdownIt from 'markdown-it';
import katex from '@vscode/markdown-it-katex';
import css from '@previewed/plugin-css';
import watch from '@previewed/plugin-watch';
import { resolve } from 'node:path';
init({
dir: resolve('./src'),
plugins: [
markdown(new MarkdownIt({ html: true }).use(katex.default)),
css(
`
.katex-html {
display: none;
}
*:not(.katex *) {
font-family: david;
direction: rtl;
}
[mathvariant=double-struck] {
text-shadow: 0.05em 0 white, 0.1em 0 black;
}
`,
{ filetypes: ['md'] }
),
watch({ filetypes: ['md'] }),
],
});