-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
style guide generation, react-styleguidist integration? #602
Comments
probably a static building could solve my problems, but as far as I can see, it miss 3 feat witch are present in react-styleguidist:
|
can the addons not fill this role somehow already? |
mmm, not sure. Btw have a longer description for the story could be a good idea? |
Hey, we have some solutions in Storybook land for this. Let me show you them: |
Hey, React Styleguidist author is here ;-) Is anyone still interested in Storybooks and React Styleguidist integration? |
I might be yes :) |
@sapegin I'm interested in the integration with styleguidist, also I'm happy to help or make the integration, happy to hear of your still interested. |
@jbovenschen Hi Jaco! I’m not very familiar how Storybook works but probably we could somehow convert stories to Styleguidist Markdown format. Probably it will require some changes in Styleguidist itself. I’m happy to discuss it ;-) |
I'm still interested in this as well, definitely! |
I will definitely follow commits on such a thing. very interested! |
one idea is a styleguidist loader. in that regard, storybook doesn't even need awareness of styleguidist. you just: .add('widget', require('styleguidist!./my-widget.md')) the loader would return the root react @sapegin, thoughts? |
Currently I try to work out something where you get a link, like "Open isolated ->" in the examples generated by styleguidist. @cdaringe Will the webpack example return the complete set of styleguidist stories? Or create new ones based on it's content, if so is it not better to create some kind of addon? |
@jbovenschen, it would load only the content as defined by |
Then what’s the difference with running Styleguidist separately if you still have to write docs in Styleguidist format? |
great point, i dont know what i was thinking. my head's on straight now! perhaps a better approach would be an addon, providing a styleguidist wrapper thingy™: import { styleguidist } from 'storybook-styleguidist'
import Button from './path/to/button'
.add('Button', styleguidist(
Button, // tells which props to inject into addon pane
() => { /* story 1 */ }, // renders normal styleguidist experience
() => { /* story 2 */ }
) maybe not ideal, because in that approach, all stories share the same viewer. instead... import { styleguidist } from 'storybook-styleguidist'
import Button from './path/to/button'
.add(styleguidist(
Button,
'story1', () => { /* story 1 */ },
'story2', () => { /* story 2 */ }
) ^^ would load the props documentation into the story1 & story2 "styleguidist" addon panes, & the stories would be laid out per the below in the storybook:
|
Hey! I like an idea to integrate them such a way that it could be possible to use Strorybook as a development tool and Styleguidist as a customizable static output. I was looking for ways to seamlessly transfer stories data to styleguidist and now I can show the example how it's possible to create markdown from storybooks via addon. storiesOf('Usual story', module)
.addStyleGuide('Simple Example', () => (
<div className="example-component">
<Button title={text('Subtitle3', 'Knob1.SubTitle')} />
</div>
), { getCode: storeCode }) It's possible to pass additional description to each story like in The big pros is that it's possible to use with other addons like In this demo you can see markdown in the addon panel after selecting single story or do it automatically to generate all of them. @sapegin @cdaringe @jbovenschen @jurgob do you have any ideas is it possible to continue and how to pass this markdown (and everything else) to Styleguidist? One of the problems could be is that do it in browser not server (now the most simple way is just save a file manually) or could we generate styleguide on a client side? So I'll be happy if it could help with this work :) |
@usulpro That’s amazing! Exactly what I was thinking (but had no idea how to implement it ;–)
That’s a good question. Generating real files is not the best way. But I don’t really know how can we connect Storybook and Styleguidist. Does Storybook have some API? Is it possible to have all Markdown snippets in Node? |
I should study Storybook API, right now I don’t understand how to connect two tools together ;-) |
I also always wondered what the difference between storybooks and styleguidist is. I think I favour the latter for its easy markdown readme and most of all, users of the guide can "write their own story", because styleguidist allows live editing of code from the (static) guide side. |
@pke Yeah, ability to generate a style guide with all components on the same page and different way of writing stories / examples are the main differences. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. We do try to do some housekeeping every once in a while so inactive issues will get closed after 90 days. Thanks! |
Hey there, it's me again! I am going to help our maintainers close this issue so they can focus on development efforts instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
This issue fits really well with this article comparing storybook and styleguidist: https://blog.hichroma.com/storybook-vs-styleguidist-2bd93d6dcc06. The TL;DR is that they both fill different needs. Storybook is great for developers creating components in isolation, and styleguidist is well-suited for creating documentation around them. The author ends by saying he he wishes the two could be combined. I agree. To accomplish this, I think we need two pieces. One is to be able to create rich documentation about a component, and https://github.com/tuchk4/storybook-readme seems perfect for that. But the piece that is still missing, I think, is being able to generate a single page with all of the documentation for all of the components. Imagine a new developer on the team looking for a particular type of component, but not knowing what it's called. It is much easier to scroll through a single page looking for something that looks right, than it is to click through the elements in a sidebar, guessing from their names. All that to say, does anyone think it might be possible to create a single page combining all of the stories together, using either |
I don't want to learn a new DSL for writing documentation. I still think styleguidist solves the problem at hand better and smoother. |
I agree that being able to pull in readme docs into stories with storybook-readme is awesome for the reasons you describe. I think the main thing still missing from storybook, is the ability to scroll down a single page and see all the components, without having to click once or twice through the scrollbar for each one. |
I'm trying to build the same, just because I want the view-port feature that storybook has with that addon but couldn't find a way to load the stories from the readme or the other way around. |
Any progress about this? |
I'm hopeful that this will give us what we are looking for: https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a |
Thanks for the quick reply, I will take a look at the article. Also thanks for the hard work what you are doing on the SB. |
@IanVS @QingLeiLi If you want to try it out, here's a more recent guide: https://docs.google.com/document/d/1un6YX7xDKEKl5-MVb-egnOYN8dynb5Hf7mq0hipk8JE/edit?usp=sharing Currently in alpha, hustling to get it into beta this week 🤞 |
Nine work! I will give it a try soon. |
Hi, is it possible to generate a style guide from the stories?
something like react-styleguidest (https://github.com/sapegin/react-styleguidist) do?
Does it make sense to write something from scratch? or maybe it make more sense to do some tools to "generate" the react-styleguidist files?
In my project I was using both react-styleguidest and react-storybook, so I wrote a storybook generator from the styleguidest examples. (here the code: https://gist.github.com/jurgob/58f6f46c34e991dc449effe5731dd693).
Maybe doing the opposite (from stories to markup files) it could be the fastest way?
Let me know what do you think
The text was updated successfully, but these errors were encountered: