Skip to content

Added gatsby-remark-babel-repl-link plug-in - #255

Merged
bvaughn merged 2 commits into
reactjs:masterfrom
bvaughn:gatsby-remark-babel-repl-link
Nov 7, 2017
Merged

bvaughn merged 2 commits into
reactjs:masterfrom
bvaughn:gatsby-remark-babel-repl-link

Conversation

@bvaughn

@bvaughn bvaughn commented Nov 7, 2017 •

Copy link
Copy Markdown
Contributor

Given a directory structure like this:
screen shot 2017-11-07 at 11 33 09 am

This plug-in converts markdown links like this:

[View this in the Babel REPL](babel-repl://tutorial-expanded-version)

And a gatsby-config like this:
screen shot 2017-11-07 at 11 40 27 am

To link format that Babel's REPL understands:

<a href="https://babeljs.io/repl/#?presets=react&amp;code_lz=DwEwlgbgBAxgNgQwM5IHIILYFMC8AiJACwHsAHUsAOwHMBaOMJAFzwD4AoKKYQgRlYDKJclWpQAMoyZQAZsQBOUAN6l5ZJADpKmLAF9gAej4cuwAK5wTXbg1YBJSswTV5mQ7c7XgtgOqEETEgAguTuYFamtgDyMBZmSGFWhhYchuAQrEA" target="_blank">
  View this in the Babel REPL
</a>

So that clicking the link opens the example code in question within the Babel REPL:
screen shot 2017-11-07 at 11 37 26 am

Hopefully this also helps avoid concerns like the ones expressed in #240. cc @ptrmelko10

@reactjs-bot

reactjs-bot commented Nov 7, 2017 •

Copy link
Copy Markdown

Deploy preview ready!

Built with commit 32a66d7

https://deploy-preview-255--reactjs.netlify.com

@bvaughn

bvaughn commented Nov 7, 2017

Copy link
Copy Markdown
Contributor Author

I'm going to merge this now b'c it fixes at least 2 broken Babel REPL code links I'm aware of. Let's chat more about it if there are concerns or follow-up work.

@bvaughn
bvaughn merged commit bc9a412 into reactjs:master Nov 7, 2017
@bvaughn
bvaughn deleted the gatsby-remark-babel-repl-link branch November 7, 2017 13:25
jhonmike pushed a commit to jhonmike/reactjs.org that referenced this pull request Jul 1, 2020
BetterZxx pushed a commit to BetterZxx/react.dev that referenced this pull request Mar 21, 2023
docs(en): merge reactjs.org into zh-hans @ 92ad9c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants