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

Allow Code Component to have custom props and extra class styles #9960

Merged
merged 30 commits into from
Mar 8, 2024

Conversation

StandardGage
Copy link
Contributor

Changes

Allows Astro's Code component to use custom props, including extra classes. Attempts to fix #9009

Testing

Used Minimal example to test changes. Specifically tested using the issue description and also tested with inline set to true.

Docs

I don't believe docs would be needed.

Copy link

changeset-bot bot commented Feb 3, 2024

🦋 Changeset detected

Latest commit: c3ca52d

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 feat: markdown Related to Markdown (scope) pkg: astro Related to the core `astro` package (scope) labels Feb 3, 2024
.changeset/calm-bags-deliver.md Outdated Show resolved Hide resolved
packages/astro/components/Code.astro Outdated Show resolved Hide resolved
Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

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

Almost there!

packages/astro/components/Code.astro Outdated Show resolved Hide resolved
packages/markdown/remark/src/shiki.ts Outdated Show resolved Hide resolved
packages/markdown/remark/src/shiki.ts Outdated Show resolved Hide resolved
@StandardGage
Copy link
Contributor Author

Hey @florian-lefebvre I've added your suggestions. You can see in the above comments the issues I found. I'm also suddenly having issues building so I don't have a great way of testing.

@florian-lefebvre
Copy link
Member

Don't worry about the failing tests called CI / Test for now, it has been caused by another PR

packages/markdown/remark/src/shiki.ts Outdated Show resolved Hide resolved
packages/markdown/remark/src/shiki.ts Outdated Show resolved Hide resolved
@florian-lefebvre
Copy link
Member

Hey @StandardGage are you still interested in this PR?

@StandardGage
Copy link
Contributor Author

Hey @florian-lefebvre , I haven't had much time to finish this PR so if it needs to be closed I understand and hopefully once I get more time I can open a new request towards this issue.

@ematipico ematipico added the semver: minor Change triggers a `minor` release label Feb 26, 2024
@florian-lefebvre
Copy link
Member

No worries, thanks for the initial effort! We'll take it from here

@florian-lefebvre florian-lefebvre self-assigned this Feb 26, 2024
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Looks great!

@ematipico
Copy link
Member

@florian-lefebvre and @bluwy, do you know if we need to update some documentation somewhere? I found only this page that mentions the Code component: https://docs.astro.build/en/reference/api-reference/#code-

@ematipico ematipico added this to the 4.5 milestone Feb 27, 2024
@florian-lefebvre
Copy link
Member

florian-lefebvre commented Feb 27, 2024

I think that's the only place. Tbh, people kinda expected additional props to work already so it feels more like a patch. VSC will show the types anyway so I think we don't need to update the docs

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.

Approving for docs!

@ematipico ematipico merged commit c081adf into withastro:main Mar 8, 2024
11 of 13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: markdown Related to Markdown (scope) 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.

Astros Code component ignores class:list attribute
5 participants