Blog

pretty-code 動作確認(テスト)

2026.01.25

rehype-pretty-codeの title / 行番号 / ハイライト の動作確認用

pretty-code 動作確認(テスト)

1) title + 行番号 + 行ハイライト#

lib/mdx.ts
ts
export const mdxOptions = {
  rehypePlugins: [
    rehypeSlug,
    // something...
  ],
}

2) titleなし + 行番号だけ#

code block
ts
const a = 1
const b = 2
console.log(a + b)

3) インラインコードの確認#

インラインは const x = 1 のように表示されればOK。