An open API service indexing awesome lists of open source software.

https://github.com/nju33/storybook-docsify

Storybook and Docsify integrator (But it's altmost Docsify 👻)
https://github.com/nju33/storybook-docsify

storybook-addon

Last synced: 2 months ago
JSON representation

Storybook and Docsify integrator (But it's altmost Docsify 👻)

Awesome Lists containing this project

README

        

# @nju33/storybook\_\_addon-docsify

## Prepare

Install like below,

```sh
yarn add -D @nju33/storybook__addon-docsify
```

And you should add the following to your `addon.js` (if you're using TypeScript then `addon.ts`).

```sh
import '@nju33/storybook__addon-docsify/dist/register';
```

Finally, place Docsify root as `index.html` following like. (The details is in [Docsify document](https://docsify.js.org/#/configuration).)

```html



Document Title








window.$docsify = {
basePath: '/',
name: 'Document',
};


```

After Docsify will do it for you. 👻

## Examples

In the below is first example.

```jsx
storiesOf('html-button', module)
// html-button/foo-bar.md
.add('foo-bar', () => foo-bar)
// html-button/bar-baz.md
.add('bar-baz', () => bar-baz);
```

In the above, The document path is `html-button/foo-bar`. In this case, Storybook has interapted key is `html-button--foo-bar` that using `--` as separator.

That `--` is handled `/` by this addon. Thus `index.html#/html-button/foo-bar` will be loaded then.

If you want to change its behavior, You maybe change it by pass to parameter into your story.

```jsx
storiesOf('html-button', module)
.addParameter({
docsify: {
path: 'html-button/README'
}
})
// html-button/README.md
.add('foo-bar', () => foo-bar)
// html-button/README.md
.add('bar-baz', () => bar-baz);
```

This addon read the parameter using by `docsify`. By setting `path`, you can make Docsify is loaded `*.md` you wish.