-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Playground on site #220
Comments
Hey, let's expand on this a bit! Which subset of MDX features would this playground have? Would we have two files, e.g. a MDX file and a JS file that imports it? What benefit would a playground provide? Something that seems unclear about MDX at first and takes a while to understand, but a playground could clear up (i. e. how you came up with this idea)? Are there some playground examples of popular libraries that you think we could draw some inspiration from? |
Maybe we could just have a REPL, like Babel, so you know what a MDX file compiles to? |
Here's an example from a very similar library: https://mapbox.github.io/jsxtreme-markdown/ |
This works fine for jsxtreme-markdown, but our output consist of a bunch of MDXTags, which might be hard and confusing to read to beginners. If we put regular HTML tags instead of MDXTags, that might be misleading because it hides the fact that people can actually customize components via Example MDX input:
Output: export default ({components, ...props}) => (
<MDXTag name="wrapper" components={components}>
<MDXTag name="p" components={components}>{`This is a paragraph.`}</MDXTag>
<div>{`This is a div.`}</div>
</MDXTag>
) The paragraph component is customizable, but the div isn't. Which aspect of this output should we show in the REPL and why? I think it makes most sense to just embed a CodeSandbox example. Thoughts? |
- new format: MDX - MDX parsers: MDXAST and MDXHAST - MDX transform: mdx Fixes fkling#343. Ref. mdx-js/mdx#235. Ref. mdx-js/mdx#220.
- new format: MDX - MDX parsers: mdxast and mdxhast - MDX transform: mdx Fixes fkling#343. Ref. mdx-js/mdx#235. Ref. mdx-js/mdx#220.
- new format: MDX - MDX parsers: mdxast and mdxhast - MDX transform: mdx Fixes fkling#343. Ref. mdx-js/mdx#235. Ref. mdx-js/mdx#220.
- new format: MDX - MDX parser: mdxhast - MDX transform: mdx Initially I thought it would be a good idea to have mdxast too, but after using AST explorer with mdxast for a while, it proved useless because all it currently does is change all "html" types into "jsx". Fixes fkling#343. Ref. mdx-js/mdx#235. Ref. mdx-js/mdx#220.
First pass is addressed in #562, thanks for opening this issue! |
It would be incredibly cool if there was playground on site ⭐
The text was updated successfully, but these errors were encountered: