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

Strange parsing issue(?) #83

Closed takase1121 closed 5 years ago

takase1121 commented 5 years ago

I have this file structure. image However when I generate the docs the tree became like this instead image (.parse is a static method in DocLoader)

onury commented 5 years ago

JSDoc does not care about the file structure. It's about class/namespace hierarchy. Docma tree outline shows that the hierarchy is not correctly documented with JSDoc.

Make sure your parse() function is a child of DocLoader. One way is this:

/**
 *  Some description...
 *  @name DocLoader.parse
 *  @function
 */
parse() { 
 // ...
}

or you could use @memberof ..

Pls consult JSDoc documentation.

takase1121 commented 5 years ago

none of your suggestion worked. Here is a snippet of code I had.

export class DocLoader {
    /**
     * Parses a file
     * @param {string} filename The filename to parse
     */
    static async parse(filename) {
        ...
    }
}

I really can't find out where's the issue

onury commented 5 years ago

It seems you didn't document DocLoader.

takase1121 commented 5 years ago

How do I do that?

takase1121 commented 5 years ago

Thanks for your help. Apparently I just have to document the classes with @class tag now it works fine.