Skip to content

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

Merged
matthewp merged 8 commits intowithastro:mainfrom
braebo:shiki-transformers
Jun 19, 2024
Merged

feat: add ShikiTransformer support to the <Code /> component#11197
matthewp merged 8 commits intowithastro:mainfrom
braebo:shiki-transformers

Conversation

@braebo
Copy link
Copy Markdown
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.

@changeset-bot
Copy link
Copy Markdown

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
@bluwy bluwy added the semver: minor Change triggers a `minor` release label Jun 7, 2024
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

I added some docs here: withastro/docs#8559

@matthewp matthewp requested review from sarah11918 June 17, 2024 20:31
Copy link
Copy Markdown
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

braebo and others added 2 commits June 17, 2024 19:51
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Copy link
Copy Markdown
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!

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@lorizz
Copy link
Copy Markdown

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.

7 participants