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

docs(www): 25 Workflows - Embedding components in Markdown with MDX #14543

Merged

Conversation

gillkyle
Copy link
Contributor

@gillkyle gillkyle commented Jun 4, 2019

Description

Clarifies and updates examples for the workflow of a new user adding components to their markdown content with MDX.

Main things changed:

  • some examples were outdated and were thus updated, with additional code snippets included to really spell out how to use different techniques for people new to MDX
  • some headers and structure was adjusted to more clearly state the intent of a given section
  • broken links were updated, and some additional links added to help explain more technical concepts

Related Issues

Addresses #14258 as part of the effort of the 25 Workflows improvements

@gillkyle gillkyle requested a review from a team June 4, 2019 21:58
@gillkyle gillkyle requested a review from a team as a code owner June 4, 2019 21:58
Copy link
Contributor

@marcysutton marcysutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I had a few suggestions, but it's in really good shape otherwise. Thanks for working on this!

docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
@gillkyle gillkyle requested a review from marcysutton June 10, 2019 15:32
@gillkyle gillkyle added status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response type: documentation An issue or pull request for improving or updating Gatsby's documentation 🎯 Learning labels Jun 10, 2019
Copy link
Contributor

@amberleyromo amberleyromo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that MDX is stable, @ChristopherBiscardi moved gatsby-mdx to gatsby-plugin-mdx, so we should use gatsby-plugin-mdx from now on.

I stopped changing these, but in this whole section, gatsby-mdx needs to be replaced with gatsby-plugin-mdx.

Also I was thinking about the heading of this whole section:

Adding Components to Content with MDX

Make more sense as something like:

Adding JavaScript to Markdown with MDX

cc @marcysutton

docs/docs/mdx/getting-started.md Show resolved Hide resolved
docs/docs/mdx/getting-started.md Outdated Show resolved Hide resolved
docs/docs/mdx/getting-started.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
docs/docs/mdx/writing-pages.md Outdated Show resolved Hide resolved
@gillkyle gillkyle requested a review from amberleyromo June 17, 2019 17:42
@gillkyle gillkyle changed the title fix(docs): Embedding components in Markdown with MDX Workflow docs(www): Embedding components in Markdown with MDX Workflow Jun 17, 2019
@gillkyle gillkyle changed the title docs(www): Embedding components in Markdown with MDX Workflow docs(www): Embedding components in Markdown with MD Jun 17, 2019
@gillkyle gillkyle changed the title docs(www): Embedding components in Markdown with MD docs(www): 25 Workflows - Embedding components in Markdown with MDX Jun 17, 2019

Similarly to what you'd do in JSX, you can import and render components
with JSX. You can also import other MDX documents.
## Importing JSX components and MDX documents
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "Importing JSX components in MDX documents"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the "and" is good because it shows that both can be imported rather than just React components. JSX components and MDX documents are able to be imported in an MDX file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, we can leave as-is!

marcysutton
marcysutton previously approved these changes Jun 18, 2019
Copy link
Contributor

@marcysutton marcysutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend that we merge this PR and make incremental updates afterward. A lot of the remaining items are around integrating docs from other sites/adding redirects. It's best to keep this moving as we want to start communicating about gatsby-plugin-mdx in the Gatsby docs, and this is the start of that effort (thanks @amberleyromo for surfacing that info!).

One outstanding item was whether to rename "Adding Components to Content with MDX" – this is an ongoing discussion that we should continue beyond this PR!

johno
johno previously approved these changes Jun 18, 2019
Copy link
Contributor

@johno johno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! ✨

@gillkyle
Copy link
Contributor Author

gillkyle commented Jun 18, 2019

Sounds like the preferred route is merge this now and incrementally improve things like an MDX section in the Gatsby API.

I think that sounds great 👍

@gillkyle gillkyle dismissed stale reviews from johno and marcysutton via 5cb0d53 June 18, 2019 23:46
amberleyromo
amberleyromo previously approved these changes Jun 18, 2019
Copy link
Contributor

@amberleyromo amberleyromo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge this now and incrementally improve things like an MDX section in the Gatsby API

👍👍👍

docs/docs/mdx/index.md Outdated Show resolved Hide resolved
Copy link
Contributor

@marcysutton marcysutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @gillkyle! I ended up making some suggestions for a landing page title change so we can close out that discussion while we're in here (the URL is all good). Thanks for your patience on this one!

docs/docs/mdx/index.md Outdated Show resolved Hide resolved
www/src/data/sidebars/doc-links.yaml Outdated Show resolved Hide resolved
gillkyle and others added 5 commits June 18, 2019 19:25
Co-Authored-By: Marcy Sutton <marcy@gatsbyjs.com>
Co-Authored-By: Marcy Sutton <marcy@gatsbyjs.com>
…om/gillkyle/gatsby into www/docs-workflow-markdown-and-mdx

# Conflicts:
#	www/src/data/sidebars/doc-links.yaml
@gillkyle
Copy link
Contributor Author

After like 10 weird merge conflicts from applying suggestions in weird orders and merging master all the titles now reflect "Adding Components to Markdown with MDX" 😅

@gillkyle gillkyle requested a review from marcysutton June 19, 2019 01:32
@marcysutton marcysutton removed the status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response label Jun 19, 2019
@marcysutton marcysutton merged commit df94c22 into gatsbyjs:master Jun 19, 2019
@marcysutton
Copy link
Contributor

This is so great. Thanks again for your work on it @gillkyle, and to @johno and @amberleyromo for reviews!

m-allanson added a commit that referenced this pull request Jun 19, 2019
* master: (41 commits)
  chore(release): Publish
  fix(gatsby): Normalize paths for run queries before caching (#14910)
  chore(release): Publish
  fix(gatsby-cli): add missing node-fetch dependency (#14908)
  feat(blog): Site Showcase Validator blogpost (#14855)
  chore(gatsby-remark-graphviz): add --ignore for test directory (#14906)
  fix(tutorials): rename "advanced" to "additional (#14847)
  fix(starters): update gatsby monorepo (#14886)
  chore(starters): Switch to useStaticQuery (#14857)
  chore(release): Publish
  Add status bar to bottom of screen during develop (#14874)
  chore(release): Publish
  fix(*): fix gatsby-cli dep in source-filesystem & plugin-sharp (#14881)
  docs(www): 25 Workflows - Embedding components in Markdown with MDX (#14543)
  docs(blog): add case study blog post for The Couch / Prima (#14871)
  docs(www): 25 Workflows - Adding CSS and/or Sass (#14779)
  fix(gatsby-transformer-react-docgen): always create description nodes (#14876)
  chore(release): Publish
  chore(gatsby): revert progressbar functionality (#14884)
  Revised "winning over engineering leaders" Docs page (#14830)
  ...
mxxk pushed a commit to mxxk/gatsby that referenced this pull request Jun 21, 2019
…atsbyjs#14543)

* chore: updates to docs to improve examples and provide more detailed explanations

* fix: simple grammatcial changes

* fix: PR review suggestions

* fix: correct code block titles and update example inline jsx

* Amberleys PR comments

* feat: add mdx as a title to code blocks

* add link to glossary for components to help disambiguate

* Update docs/docs/mdx/index.md

Co-Authored-By: Marcy Sutton <marcy@gatsbyjs.com>

* Update docs/docs/mdx/index.md

Co-Authored-By: Marcy Sutton <marcy@gatsbyjs.com>

* Update www/src/data/sidebars/doc-links.yaml

Co-Authored-By: Marcy Sutton <marcy@gatsbyjs.com>

* local merge conflicts + github suggestions = confusion
johno pushed a commit to johno/gatsby that referenced this pull request Jul 17, 2019
…atsbyjs#14543)

* chore: updates to docs to improve examples and provide more detailed explanations

* fix: simple grammatcial changes

* fix: PR review suggestions

* fix: correct code block titles and update example inline jsx

* Amberleys PR comments

* feat: add mdx as a title to code blocks

* add link to glossary for components to help disambiguate

* Update docs/docs/mdx/index.md

Co-Authored-By: Marcy Sutton <marcy@gatsbyjs.com>

* Update docs/docs/mdx/index.md

Co-Authored-By: Marcy Sutton <marcy@gatsbyjs.com>

* Update www/src/data/sidebars/doc-links.yaml

Co-Authored-By: Marcy Sutton <marcy@gatsbyjs.com>

* local merge conflicts + github suggestions = confusion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants