Storybook-readme: Integration with @storybook/addon-info or custom layouts.

Created on 8 Aug 2018  路  5Comments  路  Source: tuchk4/storybook-readme

This may be a dumb question, but would there be any consideration to provide a HOC that would be more general and just transform the markdown itself?

These are already great:

  • Panel (withReadme)
  • Story (doc)
  • Wrapper (withDocs with preview component)
  • Wrapper defined by README (withDocs with comment)

I was thinking something like this?

import { withInfo } from '@storybook/addon-info';
import { withMarkdown } from 'storybook-readme';

import INTRO from './INTRO.md';
import OUTRO from './OUTRO.md';

storiesOf('Introduction', module)
  .add('Test', withInfo()(
    <div>
      {withMarkdown(INTRO)}

      <div>Hi</div>

      {withMarkdown(OUTRO)}
    </div>
  )
;

It _might_ be able to replace the wrapper cases, assuming people want to split up their markdown files.

Thoughts?


__Context__

It looks like adding withInfo is placed within the PreviewComponent, defaulted to https://github.com/tuchk4/storybook-readme/blob/master/packages/storybook-readme/src/env/react/components/StoryPreview.js.

screen shot 2018-08-07 at 6 28 23 pm

Most helpful comment

I am going to export Markdown component at next release

All 5 comments

I am going to export Markdown component at next release

@tuchk4 Looks great!

Minor overall feedback:

  1. Would be great to link your storybook in the repository's description (little bit hard to find in the middle of the README).
  2. Would be nice if storybook followed the same hierarchy as the README, _slight_ challenge to map storybook to README.
  3. Possibly update README, or story, to match (e.g. Custom Layout > Marked)鈥擟urrently its "Custom layout" in the README and Marked > Marked1 in the story.
  4. I understand README is a different than the story, but there could be a minor correction in the README.

    -<Button label="Button before docs" />
    +<Button label="Button before intro" />
    

Many of these things are very nit, but thanks again for all your hard work!

  • [x] Would be great to link your storybook in the repository's description (little bit hard to find in the middle of the README).

  • [ ] Would be nice if storybook followed the same hierarchy as the README, slight challenge to map storybook to README.

  • [x] Possibly update README, or story, to match (e.g. Custom Layout > Marked)鈥擟urrently its "Custom layout" in the README and Marked > Marked1 in the story.

  • [x] I understand README is a different than the story, but there could be a minor correction in the README.

released in 4.0.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deehuey picture deehuey  路  3Comments

callerc1 picture callerc1  路  4Comments

mcookdev picture mcookdev  路  3Comments

beyondghx picture beyondghx  路  6Comments

kristof0425 picture kristof0425  路  9Comments