Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve API Documentation generation #12

Closed
pago opened this issue Jan 27, 2014 · 0 comments
Closed

Improve API Documentation generation #12

pago opened this issue Jan 27, 2014 · 0 comments
Assignees
Milestone

Comments

@pago
Copy link
Collaborator

pago commented Jan 27, 2014

It turns out that we're doing it wrong. After some experiments with jsdoc 3.3 (alpha), I was able to find a markup that works (includes inherited members, etc.).

/**
 * This event is fired whenever the user invokes the button, usually through a click or tap within
 * the bounds of the button. If the Button currently has the focus, it might also be fired through keyboard
 * events such as the spacebar or the enter key.
 *
 * It can be observed by listening to the `action` event of a Control.
 *
 * @event module:C#action
 * @type {object}
 * @property {HTMLElement} source - The source of the event
 */

/** 
 * The base class for all buttons.
 * @module C
 */
define(['B'], function(B) {
    /**
     * Creates a new ButtonBase. Must only be invoked by subclasses.
     *
     * @constructor
     * @alias module:C
     * @extends module:B
     * @param {object} config The configuration.
     * @param {boolean} config.enabled `true`, if the button is enabled; `false`, otherwise.
     */
    var exports = function ButtonBase(config) {
        installer(this);
        config = _.defaults(config || {}, { tabIndex: 0 });
        if(!config.skin) config.skin = new ButtonBase.Skin(this, config.element);
        Labeled.call(this, config);
        this.classList.add('jide-buttonbase');
    }
    Class(ButtonBase).extends(Labeled).def({
        /**
         * `true`, if the button is enabled; `false`, otherwise.
         *
         * A disabled button does not react to user interaction. Set the value of this property to `false` if a
         * command is currently not available.
         *
         * @type boolean
         */
        enabled: true,
        /**
         * `true`, if the button is enabled; `false`, otherwise.
         * @type module:A
         */
        enabledProperty: null,
        command: null, commandProperty: null,

        dispose: function() {
            Labeled.prototype.dispose.call(this);
            installer.dispose(this);
        }
    });

    return ButtonBase;
});

It is extremly important to include the var exports = part when defining the constructor. If that line is not present, inheritance documentation will not work.

@ghost ghost assigned pago Jan 27, 2014
@pago pago added this to the v1.0.0-beta5 milestone Feb 21, 2014
@pago pago closed this as completed Mar 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant