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

Allow customizing remarkPlugins and rehypePlugins? #25

Open
karlhorky opened this issue Oct 4, 2024 · 3 comments
Open

Allow customizing remarkPlugins and rehypePlugins? #25

karlhorky opened this issue Oct 4, 2024 · 3 comments

Comments

@karlhorky
Copy link
Contributor

Hi @cpojer ! What are your thoughts on allowing customizing remarkPlugins and rehypePlugins?

return await transform(code, {
rehypePlugins: [[rehypeRaw, { passThrough: nodeTypes }]],
// @ts-expect-error
remarkPlugins: [[shikiTwoslashFn, shikiOptions]],
});

I was looking for this just now to add remark-gfm for Markdown tables

@cpojer
Copy link
Collaborator

cpojer commented Oct 4, 2024

If it's just that one, might be worth adding as a default to ReMDX itself maybe?

@karlhorky
Copy link
Contributor Author

karlhorky commented Oct 6, 2024

Oh, yeah maybe remark-gfm would be a good default (I can open a PR for this, if someone else doesn't do that).

However, maybe there's a different remark / rehype plugin that a user would want - what do you think about also allowing configurability, in a separate PR?

@cpojer
Copy link
Collaborator

cpojer commented Oct 6, 2024

Yeah, for now let's just allow passing a custom config, and merge it into the options object here without adding new dependencies.

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

2 participants