MakeHelpers typedef
function(docMap, options, getCurrent, helpers)
Parameters
- docMap
{DocMap}
:Contains every DocObject keyed by its name.
- options
{Object}
:The options passed to bit-docs/lib/generate/generate.
- getCurrent
{function}
:Returns the current DocObject being rendered.
- 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);
}
}
}
};
};