Documentation generator for Pattern Library.
Follow @chewingumjs on twitter for news & updates.
Features
Template engine agnostic
As it is build upon node.js
it uses multiple libraries to support various template engines to generate documentation. So far it supported template engines are:
twig
- TODO
moustache
- TODO
handlebars
Copy
/Paste
Use API insted of This is not a module that generates hardcoded Lorem Ipsum
styleguide. It is a module that generates reusable patterns from template taking .json demo data as a temporary input to test the pattern. It provides API to connect front end with the back end.
Button component: TODO
Usage: TODO
Customisable look
Every self-worthy company has their own style guides and design principles they base their designs upon. Chewingum allows you to completely change visual look of the generated documentation to fit your needs. Here are some of the themes and their demos we've created:
Github (Demo) | PatternLab (Demo) | Fractal (Demo) |
---|---|---|
Usage
Part I
enough to see Chewingum in action
// setting general settingsvar src = './pattern-library/'var dest = './documentation/' // gulp modulesvar gulp = var chewingum = var browserSync = // Pattern Library// For each template file (e.g. breadcrumbs.twig) will build a documentation file.gulp // Server// Will build server for patter-librarygulp
Part II
add your way to pass style & JavaScript
// for STYLEvar sass = var postcss = var autoprefixer = // for JavaScriptvar concat = // Style// Will combine and minify all component stylesgulp // JavaScript// Will combine and minify all component JavaScript files.gulp // FOOTER// WATCHgulp// DEFAULTgulp
Options
opts.location.src
Type: String
Default: src/components/
Sets target for folder from which all the components will be taken.
opts.location.dest
Type: String
Default: dest/components/
Sets target for Pattern Library output location.
opts.filterItems
Type: Array
Default: []
Pass tabs that filter search results by regular expression. Example: [{'title': 'Atoms','regex': '01-atoms'}]
.
opts.location.styleguide
Type: String
Default: node_modules/chewingum/doc-template/
Sets target for pattern library templates. It is possible to modify existing pattern library look by moving doc-template to local folder and modifying this URL.
Contribute
Help us make this project better - Contributing guide!