onury / docma

A powerful tool to easily generate beautiful HTML documentation from JavaScript (JSDoc), Markdown and HTML files.
https://onury.io/docma
MIT License
334 stars 34 forks source link

Show typedef? #98

Closed OmgImAlexis closed 4 years ago

OmgImAlexis commented 4 years ago

Is there a way to have docma render the typedefs as well?

I couldn't find Resource or GameOptions in the docs output. They also weren't linked in the Game section of the docs. Instead just shown as GameOptions.

/**
 * @typedef {Object} Resource
 * @property {String} id A unique ID for the resource.
 * @property {'image|script|map|audio'} type
 * @property {String} source The URI.
 */

/**
 * @typedef {Object} GameOptions
 * @property {Resource[]} resources An array of global resources to be loaded.
 */

/** Game */
class Game {
    /**
     * Creates an instance of Game.
     * @param {HTMLCanvasElement} canvas
     * @param {GameOptions} options
     * @memberof Game
     */
    constructor(canvas, options) {}
};
onury commented 4 years ago

Docma renders @typedef tags. But in your case, you don't have any description for @typedef symbols.

You should either set jsdoc.undescribed to true in your docma.json, or add some description like below:

/**
 * My typedef description...
 * @typedef {Object} GameOptions
 */

// OR

/**
 * @typedef {Object} GameOptions
 * @description My typedef description...
 */

// OR

/**
 * @typedef {Object} GameOptions - My typedef description...
 */