3

I'm trying to generate jsdoc for a medium sized project. The project structure is as follows:

-src
--commands
--components
---dirA
----ComponentA.js
---dirB
----ComponentB.js
--config
--constant
--page
---pageDirA
----PageA.js
---pageDirB
----PageB.js
--util

If I generate jsdoc for this, I will just get a list of all modules in the sidebar. If I were to include all classes/modules, It will create a huge list that is not easy to navigate.

example of a class/module:

import Header from '../component/Header';

/**
 * The abstract pager modal containing components and configuration that is used on all pages.
 *
 * @author Cornel
 * @module
 */
class AbstractPage {

  constructor() {
    this._url = '';

    this._header = new Header();
  }

  get url() {
    return this._url;
  }

  get header() {
    return this._header;
  }
}

export default AbstractPage;

Is there any way of doing this so that I have a tree structure of generated documentation using jsDoc?

Harsh Patel
  • 6,334
  • 10
  • 40
  • 73
Cornel Janssen
  • 681
  • 1
  • 11
  • 33
  • What have you tried to solved your problem? I see different ways depending on the flexibility/use you want. You can for example create a new tag in the dictionary, something like `@pageModule` or whatever section you want to organize things, or hard code in your template to make it depend on folders where elements are placed.. – Kaddath Oct 29 '18 at 09:30
  • I tried using '@namespace' and '@module' to force files into subfolders. If I use namespaces it will generate a new folder on the root level and if I u modules it will not generate folders at all. – Cornel Janssen Oct 29 '18 at 09:35
  • I don't think you will get to your desired output with using these default tags (and I think it's better to keep `@namespace` for real namespaces), one way or another, you'll have to change code in your template files. For example, when i was talking about a hardocoded solution about folders placement, i was talking about looping on items in your template and test the doclet properties to sort by some folders in the path property – Kaddath Oct 29 '18 at 14:54
  • Ok, ill see if I can create a custom template then. Thanks for your time. – Cornel Janssen Oct 29 '18 at 15:31
  • Did you solved this problem. i'm currently facing the same issue. If you've find a way it would be cool to put it on github. Thanks – johannb75 Jul 25 '20 at 15:54
  • Unfortunately I didn't – Cornel Janssen Jul 30 '20 at 10:42

0 Answers0