code-hike / bright

React Server Component for syntax highlighting
https://bright.codehike.org
1.44k stars 19 forks source link

Using Bright with Markdoc #11

Closed drusellers closed 1 year ago

drusellers commented 1 year ago

I'm currently using Markdoc to pregenerate markdown on the server. I'm curious if I could use this library to process my code blocks. Would it be possible to get a sample of calling the library outside of JSX?

pomber commented 1 year ago

Hi, I haven't tried Markdoc, but if it works with React Server Components it should be possible to use it.

I found this starter https://github.com/dylanmeivis/nextjs13-starter-markdoc from @dylanmeivis using the Next app directory (which defaults to server components). Maybe you can try that and let me know if it works.

drusellers commented 1 year ago

I'm using an html generation step, so I was thinking that I could maybe hook Bright into that. I can easily use it as a RSC for sure in other parts - but was thinking of hooking it into my CMS generation step. No worries. :)