Spaces:
Running
Running
| import adapter from '@sveltejs/adapter-node' | |
| import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' | |
| import { mdsvex, escapeSvelte } from 'mdsvex' | |
| import { createHighlighter } from 'shiki' | |
| const highlighterPromise = createHighlighter({ | |
| themes: ['github-dark'], | |
| langs: ['sql', 'text'] | |
| }) | |
| /** @type {import('mdsvex').MdsvexOptions} */ | |
| const mdsvexOptions = { | |
| extensions: ['.md'], | |
| highlight: { | |
| highlighter: async (code, lang = 'text') => { | |
| const highlighter = await highlighterPromise | |
| const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'github-dark' })) | |
| return `{@html \`${html}\` }` | |
| } | |
| }, | |
| } | |
| /** @type {import('@sveltejs/kit').Config} */ | |
| const config = { | |
| extensions: ['.svelte', '.md'], | |
| preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)], | |
| kit: { | |
| adapter: adapter() | |
| } | |
| } | |
| export default config |