rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

Home Page:https://rehype-pretty.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature] standalone RSC component

o-az opened this issue · comments

commented

A plugin/component that can be imported and used as a React Server Component.
Essentially this example packaged packaged: https://rehype-pretty-code.netlify.app/#react-server-component

It will probably look something like this:

import { PrettyCode } from '@rehype-pretty/rsc'

export default async function Page() {
  return (
    <PrettyCode
      // theme, language, code/filepath, etc.
    />
  )
}

I'm not yet sure if this is feasible but it might be a good idea to do this instead and make it framework agnostic:

import { PrettyCode } from '@rehype-pretty/mdx'

Or if not feasible then: '@rehype-pretty/<framework>'