feat: rehype code block

This commit is contained in:
enscribe 2024-09-11 01:58:29 -07:00
parent f705c07d55
commit 0cf5cf226c
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
20 changed files with 503 additions and 145 deletions

View file

@ -1,15 +1,19 @@
import { rehypeHeadingIds } from '@astrojs/markdown-remark'
import mdx from '@astrojs/mdx'
import react from '@astrojs/react'
import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import {
transformerMetaHighlight,
transformerNotationDiff,
} from '@shikijs/transformers'
import { defineConfig } from 'astro/config'
import rehypeKatex from 'rehype-katex'
import rehypePrettyCode from 'rehype-pretty-code'
import remarkEmoji from 'remark-emoji'
import remarkMath from 'remark-math'
import remarkToc from 'remark-toc'
import react from '@astrojs/react'
// https://astro.build/config
export default defineConfig({
site: 'https://astro-micro-academic.vercel.app',
@ -22,10 +26,28 @@ export default defineConfig({
react(),
],
markdown: {
shikiConfig: {
theme: 'css-variables',
},
rehypePlugins: [rehypeHeadingIds, rehypeKatex],
// shikiConfig: {
// transformers: [
// transformerNotationDiff(),
// transformerNotationFocus(),
// transformerMetaHighlight(),
// ],
// },
syntaxHighlight: false,
rehypePlugins: [
rehypeHeadingIds,
rehypeKatex,
[
rehypePrettyCode,
{
theme: {
light: 'vitesse-light',
dark: 'vitesse-dark',
},
transformers: [transformerNotationDiff(), transformerMetaHighlight()],
},
],
],
remarkPlugins: [remarkToc, remarkMath, remarkEmoji],
},
server: {