[Discussion] Embed animated examples in markdown #336
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to gatsbyjs/gatsby/pull/3012
This PR shows how we could use the new
gatsby-remark-embed-snippet
plug-in I made to extract some of our more complex examples from markdown to external files that could be formatted by Prettier. The newgatsby-remark-embed-snippet
plug-in also supports a simpler way of specifying highlighted lines (see here) that I'd like to see added to thegatsby-remark-prismjs
plug-in as well so that we could use this for inline code-comments too. (I've proposed this to Kyle.)I don't think we should move all (or even most) examples from markdown to the
examples
folder- but I do think it would be nice to be able to do for some of the larger examples, or the ones that we repeat throughout the site in multiple places.I've temporarily embedded the
gatsby-remark-embed-snippet
plug-in in this PR temporarily (since it hasn't yet been merged to Gatsby). I just updated a single markdown file,content/docs/addons-animation.md
, for example. You can see the resulting output here: deploy-preview-336--reactjs.netlify.com/docs/animation.html