Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to document events using the @event tag #1621

Closed
iShibi opened this issue Jul 3, 2021 · 2 comments
Closed

Not able to document events using the @event tag #1621

iShibi opened this issue Jul 3, 2021 · 2 comments
Labels
bug Functionality does not match expectation no bug This is expected behavior

Comments

@iShibi
Copy link

iShibi commented Jul 3, 2021

Search terms

event, event tag

Expected Behavior

/**
   * Emitted when client becomes ready for use
   * @event Client#ready
*/
this.emit('ready');

This is how I used to document events using jsdoc. I couldn't find how to use the @event tag in typedoc as the docs don't describe anything about it. So, I went with the above comment. It doesn't work tho. It should have created an Events heading in the Client page where all the events should have been listed.

Actual Behavior

It doesn't render the documentataion for events that were written using the @event tag.

Steps to reproduce the bug

  1. Make a class that extends EventEmitter
  2. Use this.emit inside a method so that it emits that event when the said method gets called.
  3. Document the event like I have done above
  4. Make sure you export the class from index.ts, which is the entry point for typedoc
  5. Build the documentation
  6. Go to the page of the class you created and look for the event (Spoiler! you won't find it)
  7. Sob 😿

I removed the documentation for events from my Client class as it wasn't working but forgot to remove it from here (This is a WIP branch and haven't been merge yet, so make sure you don't search for stuff in the main branch). It's not a minimal repo but that's what I've been working on and all the details you have asked for is also available on that repo. Hope that helps.

Environment

  • Typedoc version: 0.21.1
  • TypeScript version: 4.3.4
  • Node.js version: 14.15.1
  • OS: Windows 10
@iShibi iShibi added the bug Functionality does not match expectation label Jul 3, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 3, 2021

TypeDoc uses the @event tag to change the kind of documentation that it is attached to. Today, TypeDoc only supports the @event tag for this use, which can produce docs like this from code like this.

See also:

I definitely think there's some room for improvement here, but scanning through all comments in the source code is almost certainly not going to be the answer.

@Gerrit0 Gerrit0 added the no bug This is expected behavior label Jul 5, 2021
@Gerrit0 Gerrit0 closed this as completed Jul 10, 2021
@kungfooman
Copy link

Is there still no way to support good-old JSDoc event's as they are used in jsdoc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation no bug This is expected behavior
Projects
None yet
Development

No branches or pull requests

3 participants