Socket
Socket
Sign inDemoInstall

helper-codelinks

Package Overview
Dependencies
75
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    helper-codelinks

Generate a list of links that take you to the first line of code for each method in a given directory.


Version published
Weekly downloads
64
decreased by-7.25%
Maintainers
1
Install size
867 kB
Created
Weekly downloads
 

Readme

Source

Generate a list of links that take you to the first line of code for each method in a given directory.

Install with npm

npm i helper-codelinks --save

Usage

Add a verbfile.js to your project with the following:

var verb = require('verb');

// register the helper
verb.helper('codelinks', require('helper-codelinks'));

// add a task to build your docs
verb.task('default', function () {
  return verb.src('my-documentation.md')
    .pipe(verb.dest('docs/'));
});

In your .verb.md file:

{%= codelinks('lib/', {filter: '!**/foo.js'}) %}

Results in markdown like this:

+ **[one](fixtures/one.js)**
  - [.a](fixtures/one.js#L7)
  - [.b](fixtures/one.js#L13)
  - [.c](fixtures/one.js#L19)
+ **[two](fixtures/two.js)**
  - [.c](fixtures/two.js#L7)
  - [.d](fixtures/two.js#L13)
  - [.e](fixtures/two.js#L19)

_(Code links generated by [verb] using the [api-toc] helper)_

Which renders to a list of links that looks like this:

(Code links generated by verb using the api-toc helper)

See the example verbfile.js.

  • template-helpers: Generic JavaScript helpers that can be used with any template engine. Handlebars, Lo-Dash, Underscore, or any engine that supports helper functions.
  • verb: Verb makes it dead simple to generate markdown documentation, using simple templates, with zero configuration required. A project without documentation is like a project that doesn't exist.
  • api-toc: Pass a dirname, get a markdown-formatted Table of Contents for your API.

Running tests

Install dev dependencies:

npm i -d && npm test

Contributing

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

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb-cli on April 19, 2015.

Keywords

FAQs

Last updated on 19 Apr 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc