Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to add syntax coloring? #16

Open
cpmooney opened this issue Jul 29, 2023 · 3 comments
Open

Is it possible to add syntax coloring? #16

cpmooney opened this issue Jul 29, 2023 · 3 comments

Comments

@cpmooney
Copy link

Is it possible to enable syntax coloring in this example?

I installed rehype-highlight and followed https://www.contentlayer.dev/docs/reference/source-files/make-source-a5ba4922#mdx to get this:

export default makeSource({
  contentDirPath: "./content",
  documentTypes: [Post, Page],
  mdx: {
    rehypePlugins: [highlight],
  }
})

This has not worked for me so there must be more involved. Any idea about what that might be?

@cpmooney
Copy link
Author

This pull request solves the problem:

#1

Someone should probably merge that . . .

@faiqali1
Copy link

faiqali1 commented Sep 12, 2023

Alternatively, I really like RehypePrettyCode
Great support for line highlighting and other thing deffo worth a look

@michal-weglarz
Copy link

@cpmooney Rehype Pretty Code seems to be working for me without an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants