How do I assign modules to namespaces in jsdoc?

1.6k Views Asked by At

We're using jsdoc for a very javascript-heavy project. In order to get code-documentation we let jsdoc build html-files via grunt.

So far we successfully assigned properties and methods to modules using the "memberof" keyword like this:

Example

/**
 * Short description of this module
 *
 *
 * @module hse-catalog
 */
jQuery(document).ready(function($) {
    'use strict';

    /**
     * @namespace catalog
     * @memberof module:hse-catalog
     */
    catalog = {

        selector: {
            /* Stuff in here */
        },

        /**
         * Initializes the module.
         *
         * @memberof module:hse-catalog
         */
        init: function() {
            // do init
        },

        /**
         * Indicates whether the module is ready to load.
         *
         * @return {boolean} true or false
         * @memberof module:hse-catalog
         */
        isReady: function() {
            // do stuff
        }

        /**
         * Initializes the catalog page breadcrumb.
         * @deprecated out of order
         * @memberof module:hse-catalog
         */
        initBreadcrumb: function() {
            // do stuff
        }
    };
});

This creates us a very nice html-documentation which lists all modules. If I click on one of these modules there, I see all properties and methods of this modules. So far so good.

But the real problem is that we also want modules to be assigned to certain namespaces. How do we do that? Does jsdoc support this at all?

0

There are 0 best solutions below