1.0.5 • Published 5 years ago

storybook-addon-ondevice-autodocs v1.0.5

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Storybook Addon Device AutoDocs

This addon relies on the creation of react-docgen and creates document maps for your directories.

Installation

npm i -D storybook-addon-ondevice-autodocs

Usage

  1. Run the creation of the react-docgen for the docs directory

node ./node_modules/storybook-addon-ondevice-autodocs/dist/compileDocs.js [--options]

Available Options are:

  • -d: Directory In: Which directory are you referring to, in relation to where you are executing this method? Defaults to ./src
  • -o: Directory Out: Which directory should the documentation map go to? Defaults to ./docs
  • -i: Ignored Files: Which files should it not document? Defaults to index.stories.js,index.story.js
  1. Utilize the addon in your storybook rn-addons config

import 'storybook-addon-ondevice-autodocs/register'

  1. Require the addon in your decorator at the *.stories.js level
import { withAutoDocs }            from 'storybook-addon-ondevice-autodocs';
import docs 					   from '../path/to/docs.json';

addDecorator(withAutoDocs);

storiesOf(`MyNewStories`, (<MyComponent>), { docgen: docs.MyComponent });

Contributing

  • git clone https://gitlab.com/mean-guppy/storybook-addon-ondevice-autodocs.git </path/to/your/dir>
  • npm i
  • npm run transpile