Typedoc: @param names are not rendered

Created on 4 Dec 2020  路  5Comments  路  Source: TypeStrong/typedoc

Search terms

@param hyphen

Expected Behavior

The name of the param should be visible next to the 'param' field. The @param block is followed by a parameter name and then a hyphen.

Actual Behavior

The generated document omits the actual param names and just lists the description.
Screen Shot 2020-12-04 at 13 53 11

Steps to reproduce the bug

/**
 * @param side1 - First (face) side
 * @param side2 - Second side
 * @param dir - Direction of rotation. @default 'true'
 */
interface FlipOptions  {
    side1: HTMLElement;
    side2: HTMLElement;
    dir?: -1 | 1;
    singleDir?: boolean;
    vertical?: boolean;
    lockPointer?: boolean;
}

Environment

  • Typedoc version: 0.20.0-beta.24
  • TypeScript version: 4.1.2
  • Node.js version: 12.7.0
  • OS: OSX
bug

Most helpful comment

TSDoc != TypeDoc. TypeDoc doesn't currently conform to the TSDoc standard, though support for it is planned.

That demo is particularly misleading because it doesn't parse the source code - it only grabs a comment and then renders it. I suspect that if you ran that code through api-extractor, it would complain about your use of @param

All 5 comments

This is due to the template partial for comment tags - it you to use @param tags for what they are meant to be used for, not for documenting properties. I'd accept a PR that rendered the name if present

https://github.com/TypeStrong/typedoc-default-themes/blob/7754c7df1d9280da3e90e4b500737484f979245f/src/default/partials/comment.hbs#L14-L17

This is the output of the same from https://microsoft.github.io/tsdoc
Screen Shot 2020-12-05 at 23 29 33

As you can see, it works correctly.

TSDoc != TypeDoc. TypeDoc doesn't currently conform to the TSDoc standard, though support for it is planned.

That demo is particularly misleading because it doesn't parse the source code - it only grabs a comment and then renders it. I suspect that if you ran that code through api-extractor, it would complain about your use of @param

This defect also applies to the TypeScript binding syntax for member functions:

class MyClass {
/**
* Function that does stuff
* 
* @param param1 - The first param
* @param param2 - The second param
*/
protected boundFunction = (param1: string, param2: number): void {}

Is there another way to document this syntax?

I'm not sure what you mean there. This seems to work as expected.

image

If you aren't seeing this, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings