Modules exporting a single function

111 views
Skip to first unread message

Daniel Caillibaud

unread,
Jan 26, 2016, 5:56:48 PM1/26/16
to JSDoc Users
Hi,

I'm splitting big modules in smaller ones, with modules exporting just a single function, which
can be seen like a method of the parent module.
But each small module has only the comment doc, not params doc, on a separate page

e.g.

foo/index.js
/**
* usual module exporting an object (list of functions)
* @module foo
*/


foo/bar.js :
/**
* bla bla
* @module foo/bar
* @param {string} param1 doc on param1
* @param {boolean} param2 explanations about param2
*/
function bar(param1, param2) {
// code
}
module.exports = bar


foo/baz.js :
/**
* bla bla
* @module foo/baz
* @param {string} param1 doc on param1
* @param {boolean} param2 explanations about param2
*/
function baz(param1, param2) {
// code
}
module.exports = baz


The doc generation give me a module-foo-bar.html with only the "bla bla" but without the
explanations about params

Is exporting such function a bad practice ?
Is there a way to document parameters ?
And is there a way to show the foo/bar documentation on the foo module page ?

Thanks a lot

--
Daniel

Danielo Rodríguez

unread,
Feb 15, 2017, 6:50:34 PM2/15/17
to JSDoc Users
Try adding @function with the function name to each instance, should work.
Reply all
Reply to author
Forward
0 new messages