FormidableLabs / spectacle

A React-based library for creating sleek presentations using JSX syntax that gives you the ability to live demo your code.
https://commerce.nearform.com/open-source/spectacle/
MIT License
9.75k stars 690 forks source link

How to swap out mdx-js for MDX-bundler? #1052

Open jkwchui opened 3 years ago

jkwchui commented 3 years ago

Question

I would like to swap out mdx-js for a MDX-bundler / xdm mdx parser. This change would make possible easy usage of Unified (remark/rehype) markdown plugins, as well as updates the MDX syntax to 2.0 (most noticeably removing the requirement of leaving an empty line between and content.)

Is this possible?

Background Info/Attempts

I have looked at the docs / examples of spectacle-mdx-loader and feel that this may be possible, but I haven't understood how Spectacle-Webpack interacts. Perhaps pointers there would be sufficient to get me moving along.

ryan-roemer commented 2 years ago

This repo (the core library for spectacle itself) has absolutely no knowledge whatsoever of MDX. It's completely agnostic.

The spectacle-mdx-loader is a webpack specific plugin, that transpiles MDX slides to something compatible with spectacle.

I'm guessing what you want here is to use spectacle-mdx-loader plugin as a model to write your own webpack (or bundler of your choice and usage!) plugin to translate the flavor of source MDX to a similarly compatible transpiled outpack that works with the underlying spectacle library.