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

(api help) "no readme found" for story exported as object without storiesOf #231

Open
Mazuh opened this issue Apr 29, 2020 · 2 comments
Open

Comments

@Mazuh
Copy link

Mazuh commented Apr 29, 2020

I'm mostly new to storybook and this addon, and I'm confused by reading the instructions for inserting this addon without a having storiesOf explicitly coded.

I'm used to export an object with the data I need, that's how the boilerplate I downloaded instructed and that's how it's working... except for this readme addon config. It just keeps saying "no readme found".

import IconsMd from '../instructions/Icons.md';

I tried

export default {
  title: 'Icons',
  parameters: {
    options: {
      panelPosition: 'right',
      readme: {
        content: `
<!-- STORY -->
<!-- PROPS -->
`,
        sidebar: IconsMd,
      },
    },
  },
};

and

export default {
  title: 'Icons',
  parameters: {
    options: {
      panelPosition: 'right',
    },
    readme: {
      content: `
<!-- STORY -->
<!-- PROPS -->
`,
      sidebar: IconsMd,
    },
  },
};

The panel position thing worked.. but I believe that's only me being dumb about the API for inserting the readme. Could someone help me?

@Mazuh Mazuh changed the title api helo (api help) "no readme found" for story exported as object without storiesOf Apr 29, 2020
@Kreozot
Copy link

Kreozot commented Jun 3, 2021

Any help on this?

@Kreozot
Copy link

Kreozot commented Jun 3, 2021

Solved by adding a decorator

import { addReadme } from 'storybook-readme';

export default {
  title: 'Icon',
  component: Icon,
  decorators: [addReadme],
  parameters: {
    readme: {
      sidebar: Readme,
    },
  },
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants