Skip to content

fix: storybook readme addon is not showing the readme content #498

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

Merged
merged 9 commits into from
May 24, 2023

Conversation

iOvergaard
Copy link
Contributor

The Readme addon panel is not working with Storybook v7. It is most likely due to the change to Vite, where the raw-loader from Webpack was no longer working. Also the API for addons changed quite a bit from v6 to v7, so even though it is backwards compatible, we should upgrade it to the new API.

This PR aims to load README's in through Vite using their own raw loader (?raw) and then make the addon independent on how the README's are loaded, since the API changed so much that you can't get a component name anymore. Also it makes more sense that each story loads up its own markdown anyway.

I also managed to remove the "hack" that was in place to style code blocks appropriately, so now it works with Github Markdown CSS along with SyntaxHighlighter using prismjs without moving elements around by using the customStyle option to style the PreTag.

Lastly, all stories have been updated to import their own README's and the handlebar template for new components have been updated to reflect this along with also using the new v7 StoryObj format.

@iOvergaard iOvergaard added the documentation Improvements or additions to documentation label May 23, 2023
@iOvergaard iOvergaard requested a review from JesmoDev May 23, 2023 14:19
@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-498.westeurope.azurestaticapps.net

@JesmoDev
Copy link
Contributor

LGTM

@iOvergaard iOvergaard merged commit 25a396d into v1/contrib May 24, 2023
@iOvergaard iOvergaard deleted the v1/bugfix/storybook-readme branch May 24, 2023 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants