eze
v0.12.0
Published
Eze demos / docs for Component / Styleguide authors
Downloads
89
Readme
EZE
Making creating meaninful demos / styleguides easy ❤️
Install
npm install eze -D
Create a ts (tsx) file (e.g. ./src/docs/main.ts
)
import { render } from "eze";
/** Render documentation */
render({
outputDir: __dirname + '/../../docs'
}, eze => {
/** Create a page */
eze.page({heading: 'Welcome', subDirName: 'welcome'})
/** Write some markdown */
.md(`
# Demo
This is the demo for eze
`)
/** Show some complete application demos */
.app({ entryPointPath: __dirname + '/app-1.tsx' });
});
Add a few npm scripts:
{
"scripts": {
"docs": "eze ./src/docs/main.ts",
"docs:live": "npm run docs -- --serve"
}
}
npm run docs
builds the demos out to the specified folder. HTML + JavaScript. You can push the outputdocs
folder to github, s3 or surge.sh or anywhere else you want 🌹.npm run docs:live
will build out the demos, serve the output folder (on port4000
or whatever is available in ascending order), and reload any connected browsers whenever the demo changes 🌹.