0.1.5 • Published 8 years ago

assemble-select-views v0.1.5

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

assemble-select-views NPM version NPM downloads Build Status

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:

$ npm install assemble-select-views --save

Example

assemble-select-views

Usage

var select = require('assemble-select-views');
var assemble = require('assemble');
var app = assemble();

// register the plugin
app.use(select());

Example usage

See assemblefile.js for a working example.

// 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: Assemble plugin to add methods to assemble for working with the file system, like src,… more | homepage
  • assemble: Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… more | homepage
  • base-questions: Plugin for base-methods that adds methods for prompting the user and storing the answers on… more | homepage
  • base: base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… more | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on May 09, 2016.

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago