story-tab

Generate documentation in Storybook tab

wrong package
Last updated 5 months ago by marko424 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install story-tab 
SYNC missed versions from official npm registry.

StoryTab ????

npm version build status oclif storybook

Generate component code as documentation in Storybook tab ????

Maintaining code and documentation separately makes it painful, it's easy to get them out of sync ????

Code can't lie, documentation can ????

StoryTab keeps your documentation up to date ????

Installation

# Instal StoryTab
$ npm install story-tab --save-dev

# And one of the following (depending on the used framework):
$ npm install story-tab-react --save-dev # React

Demo

StoryTab live demo

Usage

To generate StoryTab components in your project:

  • default export component and name files as:
    • [filename].storytab.[ext]
  • from your terminal:
    • cd into your project
    • run $ storytab generate react

Import generated StoryTab components into Storybook. ????

Generated StoryTab Files

  • By default generated files will be prefixed with _ for example:
    MyComponent.storytab.jsx & MyComponent.storytab.css -> _MyComponent.jsx

  • You can set custom prefix with --prefix flag:
    $ storytab generate react --prefix=CustomPrefix

  • Import generated StoryTab component and use it in story:

    import React from 'react';
    import { storiesOf } from '@storybook/react';
    
    import ButtonGreen from './_ButtonGreen';
    import ButtonRed from './_ButtonRed';
    
    const stories = storiesOf('Button', module);
    
    stories.add('Green Button', () => <ButtonGreen />).add('Red Button', () => <ButtonRed />);
    

Commands

  • Generate component code as documentation in Storybook tab

    $ storytab generate [framework]
    

    Arguments:
    framework - generate StoryTab component for desired framework ['react']
    Options:
    --prefix - generate StoryTab components with filename prefix (default '_')

  • List StoryTab possible commands

    $ storytab help
    
  • List StoryTab command details

    $ storytab help [name of command]
    

Built with StoryTab

License

MIT

Current Tags

  • 1.0.21                                ...           latest (5 months ago)

20 Versions

  • 1.0.21 [deprecated]           ...           5 months ago
  • 1.0.20 [deprecated]           ...           5 months ago
  • 1.0.19 [deprecated]           ...           5 months ago
  • 1.0.18 [deprecated]           ...           5 months ago
  • 1.0.16 [deprecated]           ...           5 months ago
  • 1.0.15 [deprecated]           ...           5 months ago
  • 1.0.14 [deprecated]           ...           5 months ago
  • 1.0.13 [deprecated]           ...           5 months ago
  • 1.0.12 [deprecated]           ...           5 months ago
  • 1.0.11 [deprecated]           ...           5 months ago
  • 1.0.10 [deprecated]           ...           5 months ago
  • 1.0.8 [deprecated]           ...           5 months ago
  • 1.0.7 [deprecated]           ...           5 months ago
  • 1.0.6 [deprecated]           ...           5 months ago
  • 1.0.5 [deprecated]           ...           5 months ago
  • 1.0.4 [deprecated]           ...           6 months ago
  • 1.0.3 [deprecated]           ...           6 months ago
  • 1.0.2 [deprecated]           ...           6 months ago
  • 1.0.1 [deprecated]           ...           6 months ago
  • 1.0.0 [deprecated]           ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |