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

Add custom components to mdx integration guide #4530

Merged
merged 9 commits into from
Aug 30, 2022

Conversation

kylebutts
Copy link
Contributor

Changes

Following withastro/docs#1234, I've added a section to the integration guide on custom components in MDX

Docs

This should be automatically pulled into the docs according to: withastro/docs#1426

@changeset-bot
Copy link

changeset-bot bot commented Aug 29, 2022

🦋 Changeset detected

Latest commit: 27c7a84

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@astrojs/mdx Patch
@e2e/preact-component Patch
@e2e/react-component Patch
@e2e/solid-component Patch
@e2e/svelte-component Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Aug 29, 2022
Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

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

Thanks for the thorough issue and PR! Have some comments on wondering and examples (most of them minor), but I'm open to feedback on any of these edits 👍

packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
kylebutts and others added 4 commits August 29, 2022 10:20
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

I think this is a FABULOUS addition to the docs, @kylebutts! 🥳

I've left some suggestions for you and @bholmesdev to consider, mostly to integrate with existing Docs conventions. Looking forward to seeing this included! 🚀

packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
packages/integrations/mdx/README.md Outdated Show resolved Hide resolved
@kylebutts
Copy link
Contributor Author

@sarah11918 @bholmesdev I incorporated all your feedback and left open the two conversations. They are incorporated in my commit, but left the convos for you to look over as you reference

</blockquote>
```

But what if you want to specify your own markup for these blockquotes? In the above example, you could create a custom `<Blockquote />` component (in any language) that has either a `<slot />` component or accepts a `children` prop. MDX provides a way to tap into this rendering and use your own custom components. In the above example, you could create a custom Blockquote component (in any language) that has either a `<slot />` component or accepts a `children` prop.
Copy link
Member

@sarah11918 sarah11918 Aug 30, 2022

Choose a reason for hiding this comment

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

Suggested change
But what if you want to specify your own markup for these blockquotes? In the above example, you could create a custom `<Blockquote />` component (in any language) that has either a `<slot />` component or accepts a `children` prop. MDX provides a way to tap into this rendering and use your own custom components. In the above example, you could create a custom Blockquote component (in any language) that has either a `<slot />` component or accepts a `children` prop.
But what if you want to specify your own markup for these blockquotes? In the above example, you could create a custom `<Blockquote />` component (in any language) that either has a `<slot />` component or accepts a `children` prop.

Thanks for incorporating the comments @kylebutts! It looks like there's some copy here twice? So I'll clean this up and then happy for you and @bholmesdev to edit for nuance/reasonableness.

Note, making some editorial decisions based strictly on formatting here, so not meant to disapprove of any previous language. I just don't like how it looks to write plural tags and stuff.

EDIT: Now I care less about changing "blockquotes" because that's how we would refer to the Markdown syntax. So, I'm reverting that. (Change it to <blockquote> elements if you prefer, but it's fine as is.)

@sarah11918
Copy link
Member

Made a quick commit to remove duplicate text, but unresolved the convo in case either of you still want to edit it! I think I'll be happy with whatever y'all go with from here. Thanks for making some little changes for fitting in with existing Docs!

Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

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

Just need a patch changeset and we're good to go! Yes, a little overkill for README changes, but it should keep our package releases in-check. Instructions on adding changesets here

@kylebutts
Copy link
Contributor Author

All set!

Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

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

Done! Ready to merge 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants