-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add a "View HTML" button #968
Comments
I have a basic working version locally. I split a A new The config update would be a new I have to write some new tests, format the HTML, and get the configuration working then I will submit a PR for review. |
I'd not include it in the core, but that could be a good plugin, so any help with the plugin API and making Styleguidist components more flexible would be super cool ;-) |
Ok, I'll have a look into that, though I am limited for time. In the meantime, I'll raise a couple of tickets and PRs to fix a bug in the slots |
Sounds great! |
@kidkuro Do you have an example of this anywhere? I'm trying to do the same thing and having trouble getting a custom configuration up and running. |
Nowhere public sorry. Also, I currently don't have access to that code. The general approach though, from memory, I think was to override You'll have to dig around in the source code to find the bits you need and how to do it. |
Many design systems can be used simply as a CSS library as well as React component library.
The styleguides document how to use the components both as React and as pure HTML with CSS classes. E.g.: https://designsystem.gov.au/components/buttons/
We are using Styleguidist and would like to add a "View HTML" button next the the "View Code" button that presents a read-only view of the currently rendered React component.
This would allow users to just download our CSS bundle and implement our components using which rendering technology is appropriate to them.
I haven't tried implementing this yet, but I would look at ways of accessing the
innerHTML
of a renderedPreview
inPlayground
, though I realise this is a little quirky from a React perspective.I would make the feature optional, and update slots to take a configuration object to determine whether to include the extra tab button and panel.
Happy to have a go at creating a pull request if you would be happy including this feature in React Styleguidist.
The text was updated successfully, but these errors were encountered: