jsdoc2md / dmd

The default output template for jsdoc2md
MIT License
39 stars 49 forks source link

Enable typicalname for anything with instance members #72

Closed klasjersevi closed 4 years ago

klasjersevi commented 5 years ago

Proper fix for #66 that enables typicalname instance member separation for any object that has instance members such as mixins or functions, not only classes.

Sample 1

/**
 * My should be documented as myFunction
 * @typicalname otherFunction
 * @this myFunction
 */
function myFunction() {
    /**
     * Should be documented as otherFunction.instanceMember
     */
    this.instanceMember = 1;
}

/**
 * Should be documented as myFunction.staticValue
 */
myFunction.staticValue = 2;

myFunction.call(otherFunction);

Sample 2

/**
 * Should be documented as myObj
 * @typicalname otherObj
 */
var myObj = {
    /** 
     *  Documented as otherObj.first
     */
    first: "hej",
    /** 
     * Documented as otherObj.second
     */
    second: true
}

this.otherObj = myObj;

Sample 3

/**
 * @module underscore
 * @typicalname _
 */

/**
 * Should be documented as _.findWhere()
 */
exports.findWhere = function () { }

/**
 * Should be documented as _.flatten()
 */
exports.flatten = function () { }
75lb commented 4 years ago

Sorry, closing. Merging this would enable the feature for all users and I'm not convinced there's a strong enough use case, that it's a feature all users need.