onury / docma

A powerful tool to easily generate beautiful HTML documentation from JavaScript (JSDoc), Markdown and HTML files.
https://onury.io/docma
MIT License
334 stars 34 forks source link

Incorrect rendering of tree in the navigation menu #103

Open ahmadassaf opened 4 years ago

ahmadassaf commented 4 years ago

Hello,

I am having issues understanding the rendering of the menu when I have nested modules, namespaces, etc. The usage of memberof .. etc. renders the content properly using jsdoc but not in docma.

I have a main namespace defined as:

/**
 * @namespace bmrExtension
 * @requires bmrExtension.uikit
 * @requires bmrExtension.profile
 */

And then two namespaces bmrExtension.uikit and bmrExtension.profile and modules acl and loggers defined as:

/**
 * @namespace bmrExtension.profile
 * @requires acl
*/
/**
 * @namespace bmrExtension.uikit
*/
/**
 * @module
 * @name acl
 * @memberof bmrExtension
*/
/**
 * @module loggers
 * @memberof bmrExtension
*/

The module loggers itself has members and so far everything renders nicely.

/**
 * @name reduxLogger
 * @memberof bmrExtension.module:loggers
 * @type {Function}
 */

image

Now, I want to add a new module that is a memberof the main namespace bmrExtension and has a bunch of members.

/**
 * @module stores
 * @memberof bmrExtension
 */

and then I have:

/**
 * @name contactStore
 * @memberof bmrExtension.module:stores
 * @type {Object}
 */

/**
 * @name fieldsStore
 * @memberof bmrExtension.module:stores
 * @type {Object}
 */

/**
 * @name flagsStore
 * @memberof bmrExtension.module:stores
 * @type {Object}
 */

/**
 * @name notificationsStore
 * @memberof bmrExtension.module:stores
 * @type {Object}
 */

/**
 * @name pageStore
 * @memberof bmrExtension.module:stores
 * @type {Object}
 */

/**
 * @name usersStore
 * @memberof bmrExtension.module:stores
 * @type {Object}
 */

and this is where it becomes interesting:

image

only two are nested properly, one is completely missing and two are nested wrongly.

When I try and render using jsdoc I get the correct member hierarchy:

image

Would love to hear your thoughts on this.

ahmadassaf commented 4 years ago

Was taking a look at https://github.com/onury/docma/issues/58 and I have a similar observations of the rendering of items above and below the index.js. Those above are the ones with the wrong order.

image

ahmadassaf commented 4 years ago

and as a sanity check, I've just renamed contactStore into zcontactStore and the it was added correctly to its place !

ahmadassaf commented 4 years ago

using https://github.com/onury/jsdoc-x this seem to be an issue with the parser rather than with docma. Opened https://github.com/onury/jsdoc-x/issues/13 to track