|
In a MDX setup. import nextMDX from "@next/mdx";
import rehypePrettyCode from "rehype-pretty-code";
/** @type {import('rehype-pretty-code').Options} */
const options = {
// See Options section below.
};
const withMDX = nextMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [],
rehypePlugins: [[rehypePrettyCode, options]],
},
});
/** @type {import('next').NextConfig} */
const nextConfig = { reactStrictMode: true };
export default withMDX(nextConfig); |
Answered by
o-az
Aug 18, 2026
Replies: 1 comment
|
@snebjorn you can do this using {
filterMetaString: (meta) => `\${meta} showLineNumbers`,
}Here's an example: https://www.val.town/x/git/rehype-pretty-code-global-lines/code/index.tsx |
0 replies
Answer selected by
o-az
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@snebjorn you can do this using
filterMetaStringconfig inoptions:Here's an example:
https://www.val.town/x/git/rehype-pretty-code-global-lines/code/index.tsx