UNPKG

helper-reflinks

Version:

Async template helper for generating a list of markdown reference links.

128 lines (81 loc) 4.74 kB
# helper-reflinks [![NPM version](https://img.shields.io/npm/v/helper-reflinks.svg?style=flat)](https://www.npmjs.com/package/helper-reflinks) [![NPM monthly downloads](https://img.shields.io/npm/dm/helper-reflinks.svg?style=flat)](https://npmjs.org/package/helper-reflinks) [![NPM total downloads](https://img.shields.io/npm/dt/helper-reflinks.svg?style=flat)](https://npmjs.org/package/helper-reflinks) [![Linux Build Status](https://img.shields.io/travis/helpers/helper-reflinks.svg?style=flat&label=Travis)](https://travis-ci.org/helpers/helper-reflinks) > Async template helper for generating a list of markdown reference links. Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save helper-reflinks ``` ## Usage ```js const reflinks = require('helper-reflinks'); ``` Since this is an async helper, it can only registered with engines that support async helpers: * [assemble](#assemble) * [templates](#templates) * [verb](#verb) ### templates Register the helper for use with [templates](https://github.com/jonschlinkert/templates) ```js const templates = require('templates'); const app = templates(); app.asyncHelper('reflinks', reflinks()); ``` ### assemble To register the helper for use with [assemble](https://github.com/assemble/assemble) ^0.6.0: ```js const assemble = require('assemble'); const app = assemble(); app.asyncHelper('reflinks', reflinks()); ``` ### verb Register the helper for use with [verb](https://github.com/verbose/verb): ```js const verb = require('verb'); const app = verb(); app.asyncHelper('reflinks', reflinks()); app.task('default', function() { app.src('.verb*.md') .pipe(app.dest('./')); }); ``` ## About <details> <summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). </details> <details> <summary><strong>Running Tests</strong></summary> 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 ``` </details> <details> <summary><strong>Building docs</strong></summary> _(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 ``` </details> ### Related projects You might also be interested in these projects: * [handlebars-helpers](https://www.npmjs.com/package/handlebars-helpers): More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate… [more](https://github.com/helpers/handlebars-helpers) | [homepage](https://github.com/helpers/handlebars-helpers "More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate, Verb, Ghost, gulp-handlebars, grunt-handlebars, consolidate, or any node.js/Handlebars project.") * [helper-related](https://www.npmjs.com/package/helper-related): Template helper for generating a list of links to the homepages of related GitHub/npm projects. | [homepage](https://github.com/helpers/helper-related "Template helper for generating a list of links to the homepages of related GitHub/npm projects.") * [template-helpers](https://www.npmjs.com/package/template-helpers): Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or… [more](https://github.com/jonschlinkert/template-helpers) | [homepage](https://github.com/jonschlinkert/template-helpers "Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or any engine that supports helper functions.") ### Contributors | **Commits** | **Contributor** | | --- | --- | | 102 | [jonschlinkert](https://github.com/jonschlinkert) | | 7 | [stefanwalther](https://github.com/stefanwalther) | ### Author **Jon Schlinkert** * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) * [GitHub Profile](https://github.com/jonschlinkert) * [Twitter Profile](https://twitter.com/jonschlinkert) ### License Copyright © 2018, [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 29, 2018._