-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarkdown.mjs
More file actions
28 lines (27 loc) · 1.1 KB
/
Copy pathmarkdown.mjs
File metadata and controls
28 lines (27 loc) · 1.1 KB
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
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
import rehypeSlug from "rehype-slug";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
/**
* Единственное описание markdown-пайплайна. Его импортируют astro.config.mjs
* (сборка сайта) и эндпоинт предпросмотра в админке, поэтому превью не может
* разойтись с тем, что реально попадёт на страницу.
*
* Аннотация обязательна: без неё TypeScript расширяет пару
* `[плагин, опции]` до массива-объединения, и конфиг перестаёт подходить
* createMarkdownProcessor.
*
* @type {Partial<import('@astrojs/markdown-remark').AstroMarkdownOptions>}
*/
export const markdownConfig = {
remarkPlugins: [remarkMath],
rehypePlugins: [
rehypeSlug,
[rehypeAutolinkHeadings, { behavior: "wrap" }],
rehypeKatex,
],
shikiConfig: {
theme: "github-dark-dimmed",
wrap: true,
},
};