Nightly Panic Munchies

    @parachutehome/create-title.macro
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    create-title.macro

    npm (scoped) status status

    Automatically generate titles for your stories in Storybook.

    This babel macro was created to streamline the developer experience when working with stories inside Storybook. The macro will automatically generate a title for your stories -- eliminating the need to write them out which can be a time saver especially when a story is nested deep inside multiple folders.

    Getting Started

    Install

    npm i --save-dev @parachutehome/create-title.macro

    If you haven't set up your project yet to support babel macros then read the guide here.

    tl;dr

    npm i --save-dev @parachutehome/create-title.macro babel-plugin-macros

    Then in your .babelrc:

    {
      "plugins": ["macros"]
    }

    Example Usage

    // src/components/Button/Button.stories.js
    
    import createTitle from '@parachutehome/create-title.macro';
    
    export default {
      title: createTitle(); // output: components/Button
      // ...
    }

    Documentation

    You can view the full documentation for this babel macro online here.

    Contributing

    If you would like to help contribute features or bug fixes to this macro, then please read the contributing guide here.

    Previous Art

    The paths.macro, created by Storybook, served as inspiration, and a great jumping off point. Big thanks for their work!

    Install

    npm i @parachutehome/create-title.macro

    DownloadsWeekly Downloads

    23

    Version

    2.0.0

    License

    ISC

    Unpacked Size

    20.8 kB

    Total Files

    15

    Last publish

    Collaborators

    • seanhealy
    • raobot
    • mngibso