Documenting child-modules

441 views
Skip to first unread message

Alex Olson

unread,
Sep 8, 2016, 6:29:34 PM9/8/16
to JSDoc Users
Sometimes I structure my modules such that a particular set of functionality is encapsulated in a sub-module:

index.js:

const submodule = require('./submodule');
exports.submodule = submodule;


submodule.js:


exports.foo = function() {};


Is there some way in JSDoc to indicate that submodule is a child module of the main module? If I use the @module annotation then it can't have a parent if I understand correctly. What's the best way to document this type of code structure?

Ideally I'd like it to kick out documentation kinda like => 

- index
   - index.submodule
     - .foo()

I hope I'm making sense.

Or maybe I'm not doing things correctly? Any help would be much appreciated!

Danielo Rodríguez

unread,
Feb 15, 2017, 6:50:34 PM2/15/17
to JSDoc Users
I have a similar problem, and I'm unable to find the solution to mine, but this may work for you.  Have you tried to use @memberof ? Do it on the header of each submodule:

/**
* @memberof parent
* @module submodule
*/

Not sure if it will work
Reply all
Reply to author
Forward
0 new messages