-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Versions
Framework: next@14.2.15
rehype-pretty-code: rehype-pretty-code@0.14.0
next.config.mjs
import nextMDX from '@next/mdx'
import { transformerNotationHighlight } from '@shikijs/transformers'
import rehypePrettyCode from 'rehype-pretty-code'
/** @type {import('rehype-pretty-code').Options} */
const options = {
theme: 'aurora-x',
keepBackground: true,
transformers: [transformerNotationHighlight()],
}
const plugins = []
plugins.push(
nextMDX({
extension: /\.(md|mdx)$/,
options: {
remarkPlugins: [],
rehypePlugins: [[rehypePrettyCode, options]],
},
})
)
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ['tsx', 'ts', 'jsx', 'js', 'md', 'mdx'],
images: {
domains: ['github.com', 'lh3.googleusercontent.com'],
},
}
export default () => plugins.reduce((_, plugin) => plugin(_), nextConfig)
Sample.mdx
# Hello world
___
This is a test page
Some `backticks` for inline.
```tsx showLineNumbers title="layout.tsx" {5-14}
import type { Metadata } from 'next'
import localFont from 'next/font/local'
import './globals.css'
const geistSans = localFont({
src: './fonts/GeistVF.woff',
variable: '--font-geist-sans',
weight: '100 900',
})
const geistMono = localFont({
src: './fonts/GeistMonoVF.woff',
variable: '--font-geist-mono',
weight: '100 900',
})
Screenshot of the code Html element
Metadata
Metadata
Assignees
Labels
No labels