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

Playground on site #220

Closed
alexander-akait opened this issue Aug 11, 2018 · 5 comments
Closed

Playground on site #220

alexander-akait opened this issue Aug 11, 2018 · 5 comments
Labels
📚 area/docs This affects documentation 💎 v1 Issues related to v1

Comments

@alexander-akait
Copy link

It would be incredibly cool if there was playground on site ⭐

@johno johno added the 📚 area/docs This affects documentation label Aug 11, 2018
@silvenon
Copy link
Contributor

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?

@silvenon
Copy link
Contributor

Maybe we could just have a REPL, like Babel, so you know what a MDX file compiles to?

@davidtheclark
Copy link

Here's an example from a very similar library: https://mapbox.github.io/jsxtreme-markdown/

@silvenon
Copy link
Contributor

silvenon commented Sep 4, 2018

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 components prop.

Example MDX input:

This is a paragraph.

<div>This is a div.</div>

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?

silvenon added a commit to silvenon/astexplorer that referenced this issue Sep 19, 2018
- new format: MDX
- MDX parsers: MDXAST and MDXHAST
- MDX transform: mdx

Fixes fkling#343.
Ref. mdx-js/mdx#235.
Ref. mdx-js/mdx#220.
silvenon added a commit to silvenon/astexplorer that referenced this issue Sep 20, 2018
- new format: MDX
- MDX parsers: mdxast and mdxhast
- MDX transform: mdx

Fixes fkling#343.
Ref. mdx-js/mdx#235.
Ref. mdx-js/mdx#220.
silvenon added a commit to silvenon/astexplorer that referenced this issue Sep 20, 2018
- new format: MDX
- MDX parsers: mdxast and mdxhast
- MDX transform: mdx

Fixes fkling#343.
Ref. mdx-js/mdx#235.
Ref. mdx-js/mdx#220.
silvenon added a commit to silvenon/astexplorer that referenced this issue Sep 20, 2018
- 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.
@johno johno added the 💎 v1 Issues related to v1 label Feb 28, 2019
This was referenced Mar 7, 2019
@johno
Copy link
Member

johno commented May 1, 2019

First pass is addressed in #562, thanks for opening this issue!

@johno johno closed this as completed May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 area/docs This affects documentation 💎 v1 Issues related to v1
Development

No branches or pull requests

4 participants