An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# assemble-select-views [![NPM version](https://img.shields.io/npm/v/assemble-select-views.svg?style=flat)](https://www.npmjs.com/package/assemble-select-views) [![NPM downloads](https://img.shields.io/npm/dm/assemble-select-views.svg?style=flat)](https://npmjs.org/package/assemble-select-views) [![Build Status](https://img.shields.io/travis/assemble/assemble-select-views.svg?style=flat)](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**

![assemble-select-views](https://cloud.githubusercontent.com/assets/383994/15114173/af5319de-15c6-11e6-8b66-1ff7bcee8ec7.gif)

## 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._