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

Feature request: support more languages/flexibility for code blocks. #200

Open
jchiem opened this issue Jul 22, 2019 · 1 comment
Open

Comments

@jchiem
Copy link

jchiem commented Jul 22, 2019

Hi,
First of all, I'd like to say thanks and great work on this project, I've found it very useful. But I've run into an issue where it'd be nice if more languages were supported for code blocks. I found that if I specify a .md code block with scss then the syntax is not recognized and styled correctly.

Issue/Background:
Specifically the reason why I'm raising this issue is that I am writing scss and have stylelint for my project so it recognizes the scss within the .md files, but the outputted code block is unstyled when presented in the storybook-readme panel which makes it less readable.

So at this point I end up with either a very difficult to read code block in the addon, or if I specify my code blocks as css, the code block is instead incorrectly styled for comments and stylelint complains about my single line comments which are valid in scss but not valid with plain css.

Suggestion:
It would be nice to be able to extend the styles with a local css/scss/js file, alternatively add support for more languages by default in the prismCodeTheme style files for example for jsx, scss.

@tuchk4
Copy link
Owner

tuchk4 commented Aug 2, 2019

As I see scss will be highlighted correctly if set language as css.

Unfortunately, I have no time to make possible to configure prism out of package :(

But I will be happy to merge PR.
Or you can add needed languages here https://github.com/tuchk4/storybook-readme/blob/master/packages/storybook-readme/src/services/highlite.js and I will merge it into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants