feat: copy button

This commit is contained in:
jason 2024-09-11 22:54:47 -07:00
parent 1012f562ff
commit 4382f7165c
22 changed files with 197 additions and 752 deletions

View file

@ -3,6 +3,7 @@ import mdx from '@astrojs/mdx'
import react from '@astrojs/react'
import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import { transformerCopyButton } from '@rehype-pretty/transformers'
import {
transformerMetaHighlight,
transformerNotationDiff,
@ -26,13 +27,6 @@ export default defineConfig({
react(),
],
markdown: {
// shikiConfig: {
// transformers: [
// transformerNotationDiff(),
// transformerNotationFocus(),
// transformerMetaHighlight(),
// ],
// },
syntaxHighlight: false,
rehypePlugins: [
rehypeHeadingIds,
@ -44,7 +38,14 @@ export default defineConfig({
light: 'vitesse-light',
dark: 'vitesse-dark',
},
transformers: [transformerNotationDiff(), transformerMetaHighlight()],
transformers: [
transformerNotationDiff(),
transformerMetaHighlight(),
transformerCopyButton({
visibility: 'hover',
feedbackDuration: 1000,
}),
],
},
],
],