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

Show Code Open by default #8356

Closed
PaulieScanlon opened this issue Oct 9, 2019 · 11 comments
Closed

Show Code Open by default #8356

PaulieScanlon opened this issue Oct 9, 2019 · 11 comments

Comments

@PaulieScanlon
Copy link

PaulieScanlon commented Oct 9, 2019

Hey team, CSF is great but it would be even better if it were possible to configure the 'stories'

Where you currently have the "Show code" could there be config to allow this to show code by default and for the button to say "Hide code"

I'd be happy to contribute if someone could point me in the right direction.

Screenshot 2019-10-09 at 11 56 31

@sinharaksh1t
Copy link

I'd like to help contribute too. We can work together if you want @PaulieScanlon :)
I would, however, wait for the author(s) to give us a green signal to work on it.

@shilman
Copy link
Member

shilman commented Oct 10, 2019

Thanks for volunteering! 🚀

I'd propose the following configuration API:

addParameters({ docs: { previewSource: 'open' } })

This would get translated into <Preview withSource='open'> here: https://github.com/storybookjs/storybook/blob/next/addons/docs/src/blocks/DocsPage.tsx#L94

Before you start, you should wait for this fix to get merged/released: #8024

@PaulieScanlon
Copy link
Author

Hey @sinharaksh1t yeah great! that sounds like a fab idea! Thanks for your input @shilman i'll keep an eye on #8024

@sinharaksh1t
Copy link

Fantastic. Sounds like we're in an agreement then. I'll also keep an 👀 out for #8024. Once that gets merged, we'll start work on this. Thanks @PaulieScanlon and @shilman.

@sinharaksh1t
Copy link

So it looks like #8024 has been merged successfully?

@qooban
Copy link

qooban commented Nov 21, 2019

Slightly related comment:

I'd like to add live editor in our Storybook (as #6642 is not yet implemented) and if I can get more options for stories customization (especially that Show/Hide code part) from CSF it'll be great.

I know that we can use MDX for bigger customization, but as for me DocsPage is good enough and I don't need to create MDX documentation for each component. I'd only like to have an option to customize the story view (especially source code view).

@shilman
Copy link
Member

shilman commented Nov 26, 2019

@qooban track this issue #7479

@stale
Copy link

stale bot commented Dec 17, 2019

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. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Dec 17, 2019
@stale
Copy link

stale bot commented Jan 16, 2020

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap 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!

@signal-intrusion
Copy link

Any status update on this?

@shilman shilman reopened this Oct 20, 2020
@stale stale bot removed the inactive label Oct 20, 2020
@shilman shilman self-assigned this Oct 22, 2020
@shilman shilman added this to the 6.1 docs milestone Oct 22, 2020
@shilman shilman modified the milestones: 6.1 docs, 6.2 docs Nov 24, 2020
@shilman shilman modified the milestones: 6.2 docs, 6.2 candidates Mar 4, 2021
@shilman
Copy link
Member

shilman commented Apr 1, 2021

closing as dupe to #10430

@shilman shilman closed this as completed Apr 1, 2021
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

5 participants