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

feat: add ShikiTransformer support to the <Code /> component #11197

Merged
merged 8 commits into from
Jun 19, 2024

Conversation

braebo
Copy link
Contributor

@braebo braebo commented Jun 6, 2024

Changes

  • <Code /> now accepts a transformers prop and forwards it to the highlighter.

Testing

I tested the transformers and they work like a charm!

Docs

/cc @withastro/maintainers-docs for feedback!

I just assumed the transformers prop would work out of the box, and the prop is already documented with tsdoc with links to shiki's docs, so I'm not certain docs are necessary on this end. Nevertheless, a mention of the new prop in the docs wouldn't hurt.

Copy link

changeset-bot bot commented Jun 6, 2024

🦋 Changeset detected

Latest commit: 075fa07

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

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: astro Related to the core `astro` package (scope) label Jun 6, 2024
.changeset/fluffy-carrots-search.md Outdated Show resolved Hide resolved
@bluwy bluwy added the semver: minor Change triggers a `minor` release label Jun 7, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@ematipico ematipico added this to the 4.11.0 milestone Jun 11, 2024
@ematipico
Copy link
Member

Thank you, @braebo, for the contribution! We want to ship this feature in v4.11, and in order to do so, we would appreciate it if you could expand the changeset a bit, maybe by showing an example of how this new feature can be used, using a markdown code block.

@braebo
Copy link
Contributor Author

braebo commented Jun 16, 2024

Example added! Lmk if that works @ematipico

I'm actually using the component for a new docs page if you want to see it in action 🙏 https://pocket-shader.braebo.dev

@matthewp
Copy link
Contributor

I added some docs here: withastro/docs#8559

Copy link
Member

@TheOtterlord TheOtterlord left a comment

Choose a reason for hiding this comment

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

Quick review for the example in the changelog

.changeset/fluffy-carrots-search.md Outdated Show resolved Hide resolved
.changeset/fluffy-carrots-search.md Outdated Show resolved Hide resolved
braebo and others added 2 commits June 17, 2024 19:51
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.

Great feature addition @braebo ! Just left a small suggestion for a line for the changeset that I think would be a helpful inclusion. See what you think!

.changeset/fluffy-carrots-search.md Show resolved Hide resolved
@matthewp matthewp merged commit 4b46bd9 into withastro:main Jun 19, 2024
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jun 19, 2024
@lorizz
Copy link

lorizz commented Jul 2, 2024

Thanks Fractal, finally someone helping with the astro development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants