dev-novel is a clone of the well known storybook.js. It allows you to browse through example of a library. It's less complete than Storybook but works with every JS library, it's not linked to React components exclusively.
Getting started
Installation
$ npm i -D dev-novel OR
$ yarn add -D dev-novel
You will need your own build system (like webpack or rollup) to process the javascript and serve the page for you. You need to serve an index.html with a body tag and voilà!
Usage
First define your stories:
import{storiesOf}from'dev-novel'
storiesOf('My first story')
.add('Hello world',(container:HTMLDivElement)=>{
// create `<h1>Hello world</h1>`
consttitle=document.createElement('h1')
title.innerText='Hello world'
// display it into the story result
container.appendChild(title)
})
You can add initializers / disposers that runs before and after your story:
This can be useful when you need to provide globals for your story, for instance depending onto another library.