helpers/helper-ask-include

Name: helper-ask-include

Owner: Helpers

Description: Async template helper that prompts the user to choose the `include` or `includes` to render.

Created: 2016-07-27 18:15:03.0

Updated: 2017-02-20 07:33:45.0

Pushed: 2017-02-20 07:33:43.0

Homepage: null

Size: 9

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

helper-ask-include NPM version NPM monthly downloads NPM total downloads

Async template helper that prompts the user to choose the include or includes to render.

Install

Install with npm:

m install --save helper-ask-include
Usage
templates = require('templates');
questions = require('base-questions');
app = templates();

use(questions());
engine('md', require('engine-base'));
asyncHelper('askInclude', require('helper-ask-include'));

create('pages');
create('includes');

include('a.md', {content: 'this is AAA'});
include('b.md', {content: 'this is BBB'});
include('c.md', {content: 'this is CCC'});

page = app.page('index.md', {
ntent: 'Before\n<%= askInclude("includes") %>\nAfter'


render(page, function(err, res) {
 (err) return console.log(err);
nsole.log(res.content);

About
Contributing

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

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

m 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:

m install && npm test
Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. MIT


This file was generated by verb-generate-readme, v0.4.2, on February 20, 2017.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.