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

Remark and rehype plugins #562

Merged
merged 16 commits into from
Jul 1, 2021

Conversation

akellbl4
Copy link

@akellbl4 akellbl4 commented Jun 27, 2021

Resolves #239

Changes

  • adds the ability to configure remark plugins
  • adds the ability to configure rehype plugins
  • adds example with remark plugins

Testing

  • add tests

Docs

  • add docs

@changeset-bot
Copy link

changeset-bot bot commented Jun 27, 2021

🦋 Changeset detected

Latest commit: c25ecff

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

This PR includes changesets to release 2 packages
Name Type
astro Minor
@astrojs/markdown-support Minor

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

@vercel
Copy link

vercel bot commented Jun 27, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/astro-www/J2EDW3U51QRnE2CQKNQQwf5trs4x
✅ Preview: https://astro-www-git-fork-akellbl4-add-hook-for-remark-plugins-pikapkg.vercel.app

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Overall looks great! A few suggestions, but I think this is really close. Thanks for jumping right on this!

  • Could you add a .astro page that uses import { Markdown } from 'astro/components' to the example here?

@natemoo-re
Copy link
Member

cc @matthewp if you could take a look at how the remark/rehype plugins are loaded that would be awesome. I feel like this might need to use the configManager you introduced?

@akellbl4
Copy link
Author

@natemoo-re thank you for the review, I wanted to make sure if I'm on the right way

@matthewp
Copy link
Contributor

I left some comments.

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

lgtm, will defer to @natemoo-re on any changes he thinks are important.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

This looks great!

Do you want to work on integrating these changes with import { Markdown } from 'astro/components'; in a .astro file or would you be more comfortable if I did that?

@akellbl4
Copy link
Author

akellbl4 commented Jun 29, 2021

@natemoo-re I would love to help with that.

Should I add docs for the feature?
I'm not really sure how I can add tests for it.

@natemoo-re
Copy link
Member

@akellbl4 Awesome! Why don't you add some docs to this branch and I will add tests? I'm thinking about splitting <Markdown> support into another branch.

@natemoo-re
Copy link
Member

@akellbl4 looks amazing—thank you SO much for all your work on this!

I'm going to take care of the tests tomorrow and then this should be good to merge.

@akellbl4
Copy link
Author

akellbl4 commented Jul 1, 2021

@natemoo-re thank you for your help! It's pleasure to work on the project.
I have a few requests that already exist, for example, this one #397, but it's blocked by another issue. I would love to help with it or whatever blocks it.

@natemoo-re
Copy link
Member

@akellbl4 Docs look great and I added some tests to make sure there aren't regressions.

Thanks again for getting this over the line, folks will be really excited about this feature!

@natemoo-re natemoo-re merged commit d396943 into withastro:main Jul 1, 2021
@wooorm
Copy link

wooorm commented Jul 1, 2021

Awesome stuff!

SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* remark plugins

* remove unused dependency

* enable codeblocks

* backward compatibility with remark-code-titles

* add support for rehype plugins

* add proper types for plugins

* fixes after review

- connect plugins by name
- make plugins configurable
- connect gfm and footnotes if no plugins provided from config
- add more plugins to example

* update and rename example

* add documentation for markdown plugins

* chore: rename with-markdown-plugins example

* chore: restructure dependencies

* feat: add back smartypants, fix mdx expressions

* chore: remove log

* test: add markdown plugin tests

* chore: add changeset

* docs: update markdown doc

Co-authored-by: Nate Moore <nate@skypack.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💡 RFC: provide hook for custom markdown renderer
4 participants