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

Support for .mdx extension #144

Closed
dweiger opened this issue Jan 15, 2024 · 4 comments
Closed

Support for .mdx extension #144

dweiger opened this issue Jan 15, 2024 · 4 comments

Comments

@dweiger
Copy link

dweiger commented Jan 15, 2024

Hey,
would it be a conceivable feature to support .mdx extension in addition to .tsx/.jsx?
I am currently using the plugin to create component documentation. I also use mdx for this documentation.

I am currently using the following work around to get the path /myPage rendering mdx:

Folder structure:

pages
 myPage
  _myPage.mdx
   index.tsx

Inside index.tsx I simply export the mdx component:

import  MyPage from "./_myPage.mdx";

export default MyPage;

This works well with @mdx-js/rollup. Nevertheless, in my opinion it would be a great feature to support mdx - if used and set up in the project - as extension. So that the following would be possible:

pages
 myPage.mdx

What do you think about it?

@oedotme
Copy link
Owner

oedotme commented Jan 16, 2024

Hey @dweiger, thanks for the suggestion. Could you please provide a StackBlitz repro with the example you've mentioned with @mdx-js/rollup?

@dweiger
Copy link
Author

dweiger commented Jan 16, 2024

Hey, thanks for the quick reply.
Here I have a StackBlitz repo with the example.

@oedotme
Copy link
Owner

oedotme commented Jan 16, 2024

Hey @dweiger, I've added support for .mdx files at v1.18.2, here's a StackBlitz example and example repo based on the react-router example. It only requires installing and configuring @mdx-js/rollup with Vite.

Please let me know if you encounter any issue, thanks.

@oedotme oedotme closed this as completed Jan 16, 2024
@dweiger
Copy link
Author

dweiger commented Jan 17, 2024

Hey @oedotme,
thank you very much. I have already tried it and so far everything looks great! It's great how quickly you took care of it! If I stumble across any issues, I will of course let you know!

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