-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Documentation]: FAQ: Adding new languages to the syntax highlighter is no longer an issue #25307
Comments
This is actually a regression. At some point all of the themes got added back into the doc blocks, so the bundle size is much larger than it should be. I hope we are able to fix this in 8.0. Once we do, Storybook will be more efficient but this documentation will be needed. |
Hi @shilman , I'm working on a design system using ScalaJS (ScalaJS-React, to be exact) and we would love to show scala code in codeblock. May I ask, how do we enable Scala language support for codeblock? Thank you for working on Storybook, it's really good. |
I was able to get the code highlight syntax for import { SyntaxHighlighter } from '@storybook/components';
import scss from 'react-syntax-highlighter/dist/esm/languages/prism/scss';
SyntaxHighlighter.registerLanguage('scss', scss); |
Great find @psychobolt 😍 I noticed import { SyntaxHighlighter } from '@storybook/components';
import scss from 'refractor/lang/scss';
SyntaxHighlighter.registerLanguage('scss', scss); |
Describe the problem
Currently the FAQ states
Thanks to #23166 / #19794 / #21341 this is no longer an issue.
With storybook 7.6.3 and these packages
this code in
preview.ts
enables code highlighting in mdx:
Additional context
No response
The text was updated successfully, but these errors were encountered: