MakeHelpers typedef

function(docMap, options, getCurrent, helpers)

Parameters

  1. docMap {DocMap}:

    Contains every DocObject keyed by its name.

  2. options {Object}:

    The options passed to bit-docs/lib/generate/generate.

  3. getCurrent {function}:

    Returns the current DocObject being rendered.

  4. helpers {bit-docs-generate-html}:

    The default helpers object that the return value will be added to.

Returns

{Object<String,function>}:

A map of Handlebars function helpers that will be registered.

Use

To create a helper that loops through every function's name excluding the current page's name:

module.exports = function(docMap,options,getCurrent, defaultHelpers, Handlebars){
  return {
    eachFunction: function(options){
      for(var name in docMap) {
        var docObject = docMap[name];
        if(docObject.type === "function" && name !== getCurrent().name) {
          return options.fn(name);
        }
      }
    }
  };
};