-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmdsvex.config.js
47 lines (42 loc) · 1.79 KB
/
mdsvex.config.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { defineMDSveXConfig as defineConfig } from 'mdsvex';
// import remarkAbbr from 'remark-abbr';
import remarkUnwrapImages from "remark-unwrap-images";
import remarkRelativeImages from "mdsvex-relative-images";
// import remarkContainers from 'remark-containers';
import rehypeSlug from 'rehype-slug';
// import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import remarkFrontmatterImport from './mdsvexplugins/mdsvex-frontmatter-to-import.js'
import remarkAutoloadComponents from './mdsvexplugins/mdsvex-import-components.js'
import remarkAutoloadTemplates from './mdsvexplugins/mdsvex-import-templates.js'
import rehypePrettyCode from "rehype-pretty-code";
import rehypeCodeTitles from 'rehype-code-titles';
const rehypePrettyCodeOptions = {
theme: "catppuccin-frappe",
};
const config = defineConfig({
layout: {
_: "./src/lib/mdsvex/layouts/default.svelte"
},
extensions: ['.svelte.md', '.md', '.svx', '.page'],
highlight: false,
smartypants: {
},
rehypePlugins: [
rehypeCodeTitles,
[rehypePrettyCode, rehypePrettyCodeOptions],
rehypeSlug, // Add IDs to headings
// [rehypeAutolinkHeadings, { behavior: 'before' }]
],
remarkPlugins: [
// [remarkAbbr, { expandFirst: true }], // parse html abbreviations
// remarkContainers, // processes `:::`-Tags to html-tags
// [remarkMermaid, { simple: true }],
// remarkGfm,
remarkFrontmatterImport, // looks for 'image' tag in frontmatter and makes them available/imports to page metadata
remarkUnwrapImages, // removes p-tags arround images generated by markdown
remarkRelativeImages, // Imports relative linked images and makes them available to vite imagetools
remarkAutoloadComponents, // Adds js import scrip for components
remarkAutoloadTemplates, // Adds js import script for templates
]
});
export default config;