Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/generate/generate-collections
Add the docs, includes, badges, and layouts collections, along with a few generic defaults to your generator.
https://github.com/generate/generate-collections
generator project-template scaffold templates
Last synced: about 3 hours ago
JSON representation
Add the docs, includes, badges, and layouts collections, along with a few generic defaults to your generator.
- Host: GitHub
- URL: https://github.com/generate/generate-collections
- Owner: generate
- License: mit
- Created: 2016-02-14T23:44:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-27T23:23:35.000Z (over 7 years ago)
- Last Synced: 2024-10-13T14:16:54.546Z (about 1 month ago)
- Topics: generator, project-template, scaffold, templates
- Language: JavaScript
- Size: 34.2 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# generate-collections [![NPM version](https://img.shields.io/npm/v/generate-collections.svg?style=flat)](https://www.npmjs.com/package/generate-collections) [![NPM monthly downloads](https://img.shields.io/npm/dm/generate-collections.svg?style=flat)](https://npmjs.org/package/generate-collections) [![NPM total downloads](https://img.shields.io/npm/dt/generate-collections.svg?style=flat)](https://npmjs.org/package/generate-collections) [![Linux Build Status](https://img.shields.io/travis/generate/generate-collections.svg?style=flat&label=Travis)](https://travis-ci.org/generate/generate-collections)
> Initializes a handful of (empty) template collections to your generator, such as docs, includes, badges, and layouts, along with a few generic defaults.
You might also be interested in [generate-file](https://github.com/generate/generate-file).
## Install
Install as a `devDependency` with [npm](https://www.npmjs.com/):
```sh
$ npm install --save-dev generate-collections
```## Usage
Use as a plugin, to initialize commonly used [view collections](#collections-created) (no views are actually added to the collections).
```js
module.exports = function(app) {
app.use(require('generate-collections'));
// do other generator stuff
};
```## Collections created
Adds the following view collections to your generator:
### Renderable
Templates for files intended to be written to the file system.
* `files`
**Example usage**
```js
app.files('templates/*.md');
```### Layouts
Templates to be used as layouts (for "wrapping" other templates or content):
* `layouts`
```js
app.layouts('templates/layouts/*.md');
```### Partials
Templates to be used as partials (for injecting into other templates)
* `includes`
* `badges`
* `docs````js
app.partials('templates/partials/*.md');
```## Smart plugin
This generator follows [base](https://github.com/node-base/base) "smart plugin" conventions, so it can be used as a plugin with any of the following libraries:
* [generate](https://github.com/generate/generate): in your local `generator.js` file or globally installed `generate` generator.
* [assemble](https://github.com/assemble/assemble): in your local `assemblefile.js` file or globally installed `assemble` generator.
* [update](https://github.com/update/update): in your local `updatefile.js` file or globally installed `update` generator.
* [verb](https://github.com/verbose/verb): in your local `verbfile.js` file or globally installed `verb` generator.## About
### Related projects
* [generate-license](https://www.npmjs.com/package/generate-license): Generate a license file for a GitHub project. | [homepage](https://github.com/generate/generate-license "Generate a license file for a GitHub project.")
* [generate-mocha](https://www.npmjs.com/package/generate-mocha): Generate mocha test files. | [homepage](https://github.com/generate/generate-mocha "Generate mocha test files.")
* [generate-node](https://www.npmjs.com/package/generate-node): Generate a node.js project, with everything you need to begin writing code and easily publish… [more](https://github.com/generate/generate-node) | [homepage](https://github.com/generate/generate-node "Generate a node.js project, with everything you need to begin writing code and easily publish the project to npm.")### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Building docs
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```### Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 27, 2017._