deno_doc icon indicating copy to clipboard operation
deno_doc copied to clipboard

Render `@example` JSDoc tag for constructor

Open moreal opened this issue 1 year ago • 0 comments

Now, it doesn't render @example JSDoc tag for classes' constructors. When to run deno doc --html ./mod.ts && open docs/~/A.html with mod.ts file:

// mod.ts
export class A {
    /**
     * @example Creates an instance.
     * ```
     * new A();
     * ```
     */
    constructor() {}

    /**
     * @example Call a method.
     * ```
     * const a = new A();
     * a.method();
     * ```
     */
    method() {}
}

It can see A.prototype.method's example but it cannot see A.prototype.constructor's example.

No route for A.prototype.constructor

image

It can see A.prototype.method's example at docs/~/A.prototype.method.html

Screenshot 2024-06-11 at 10 54 07 AM

moreal avatar Jun 11 '24 01:06 moreal