-
Notifications
You must be signed in to change notification settings - Fork 158
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: added filename extension support for more x-codeSamples languages #1382
Conversation
🦋 Changeset detectedLatest commit: f83f49e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing! Left a few comments. Also please make sure to update the appropriate test case.
I've made changes to the test at |
Co-authored-by: Andrew Tatomyr <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you again!
What/Why/How?
The documentation for x-codeSamples mentions that
lang
names are supported based on this list. However, when it comes to writing the examples in their own files, thelangToExt
utility function only supports a subset of languages.So, for example, if I use the lang
TypeScript
, the language isn't checked for in thelangToExt
function, which results in the file being namesgetundefined
, as the extension file name is undefined.This PR adds support for all the languages mentioned by the languages list, and additionally adds support for
tsx
language. As part of our project, we needed the support for it.Reference
Testing
Screenshots (optional)
Check yourself
Security