7

I have a Backbone boilerplate based project, that I want to document with recent jdoc-toolkit

Though I can't get it to generate anything but empty _global class

Code sample:

/**
 * This is a root model for DLClass
 * @module models/DLClass
 */
define([
    'underscore',
    'backbone'
], /** @lends DLClass */ function (_, Backbone) {        
    /**
     * This is a root model for DLClass
     * @class DLClass
     * @constructor
     * @return Session Object
     */
    var DLModel = Backbone.Model.extend({
        /** @lends DLClass.prototype */

    /**
     * Generic tap event
     * @param touchEvent
     */
    onTap: function (touchEvent) {

    },
Max The Cat
  • 401
  • 2
  • 5
  • 16
  • You may not consider this a terribly helpful suggestion, but you may want to consider that you could gain all or almost all of the desired benefits by just using JSDoc the way you already are, and never generating documentation files. Your developers should be perfectly capable of reading the documentation inside .js files, without needing generated HTML, and by doing that you'd completely avoid the issue in this question. – machineghost Apr 26 '13 at 05:06

1 Answers1

3

Try adding the @namespace to let JSDoc know to look through the contents of the module. And define your module and it's functions using @name.

/** 
 * This is a root model for DLClass
 * @module models/DLClass
 * @namespace
 */
define([
    'underscore',
    'backbone'
], /** @lends DLClass */ function (_, Backbone) {        
    /**
     * This is a root model for DLClass
     * @class DLClass
     * @module models/DLClass
     * @name DLClass
     * @constructor
     * @return Session Object
     */
    var DLModel = Backbone.Model.extend({
        /** @lends DLClass.prototype */

        /**
         * Generic tap event
         * @name DLClass.onTap
         * @function
         * @param touchEvent
         */
        onTap: function (touchEvent) {

        },
Amy
  • 7,388
  • 2
  • 20
  • 31