https://github.com/assemble/assemble-select-views
Assemble plugin that adds a `.selectViews` method to the instance, for prompting the user to select the views they want to write to the file system.
https://github.com/assemble/assemble-select-views
assemble-plugin file prompt view
Last synced: about 1 year ago
JSON representation
Assemble plugin that adds a `.selectViews` method to the instance, for prompting the user to select the views they want to write to the file system.
- Host: GitHub
- URL: https://github.com/assemble/assemble-select-views
- Owner: assemble
- License: mit
- Created: 2016-05-09T12:46:45.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-09T17:03:17.000Z (about 10 years ago)
- Last Synced: 2025-02-16T10:15:04.949Z (over 1 year ago)
- Topics: assemble-plugin, file, prompt, view
- Language: JavaScript
- Size: 28.3 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# assemble-select-views [](https://www.npmjs.com/package/assemble-select-views) [](https://npmjs.org/package/assemble-select-views) [](https://travis-ci.org/assemble/assemble-select-views)
Assemble plugin that adds a `.selectViews` method to the instance, for prompting the user to select the views they want to write to the file system.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install assemble-select-views --save
```
**Example**

## Usage
```js
var select = require('assemble-select-views');
var assemble = require('assemble');
var app = assemble();
// register the plugin
app.use(select());
```
**Example usage**
See [assemblefile.js](assemblefile.js) for a working example.
```js
// create a collection
app.create('pages');
// add "pages" to the collection
app.page('a.hbs', {content: 'this is {{name}}', data: {name: 'Foo'}});
app.page('b.hbs', {content: 'this is {{name}}', data: {name: 'Bar'}});
app.page('c.hbs', {content: 'this is {{name}}', data: {name: 'Baz'}});
// register an engine for rendering ".hbs" files
app.engine('hbs', require('engine-handlebars'));
// ask the user which "pages" they want to render
// and write to the file system
app.selectViews('pages', function(err, views) {
if (err) {
console.log(err);
return;
}
console.log('done!');
});
```
## Related projects
You might also be interested in these projects:
* [assemble-fs](https://www.npmjs.com/package/assemble-fs): Assemble plugin to add methods to assemble for working with the file system, like src,… [more](https://www.npmjs.com/package/assemble-fs) | [homepage](https://github.com/assemble/assemble-fs)
* [assemble](https://www.npmjs.com/package/assemble): Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… [more](https://www.npmjs.com/package/assemble) | [homepage](https://github.com/assemble/assemble)
* [base-questions](https://www.npmjs.com/package/base-questions): Plugin for base-methods that adds methods for prompting the user and storing the answers on… [more](https://www.npmjs.com/package/base-questions) | [homepage](https://github.com/node-base/base-questions)
* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://www.npmjs.com/package/base) | [homepage](https://github.com/node-base/base)
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/assemble/assemble-select-views/issues/new).
## Building docs
Generate readme and API documentation with [verb](https://github.com/verbose/verb):
```sh
$ npm install verb && npm run docs
```
Or, if [verb](https://github.com/verbose/verb) is installed globally:
```sh
$ verb
```
## Running tests
Install dev dependencies:
```sh
$ npm install -d && npm test
```
## Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/assemble/assemble-select-views/blob/master/LICENSE).
***
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 09, 2016._