docascode / Node2DocFX

An API documentation generator for JavaScript.
MIT License
3 stars 3 forks source link

Class properties aren't included in output YAML #13

Open pmn opened 3 years ago

pmn commented 3 years ago

It doesn't seem possible to report properties on a class using this library. The example below works well in vanilla JSDoc, but the properties don't show up anywhere. The method does show up in the YAML although it doesn't mark it as async.

How do properties need to be annotated so that they turn up in the DocFX YAML?


/**
 * A fruit
 * @param name {string} - The name of the fruit
 * @property color {string} - The fruit's color
 * @property weight {float} - The fruit's weight.
 * @property sourceFarm {Object} - The farm the fruit was grown in.
 */
class Fruit {
    constructor(name) {
        this.name = name;

        let fruitData = getFruitData(name);

        this.color = fruitData.color;
        this.weight = fruitData.weight;
        this.sourceFarm = fruitData.sourceFarm;

       /** Eat the fruit */
       async function eat() {
           // Eat the fruit... 
       } 
}

JSDoc output:

Screen Shot 2021-03-23 at 14 33 50

Doc2FX output:

Screen Shot 2021-03-23 at 14 38 53