-
Notifications
You must be signed in to change notification settings - Fork 7
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
@event JSDoc keyword is not emit event documentation #30
Comments
@alexprey How to document multiple forwarded events? For example: <!--
@event focus - fires when focus changes
@event change - fires when value changes
-->
<input on:focus on:change /> this does not seem to work. I'm not sure what the preferred way of documenting these is. |
Hi @ekhaled, <script>
/**
* Fires when focus changes
* @event focus
*/
/**
* Fires when value changes
* @event change
*/
</script>
<input on:focus on:change /> or in HTML: <!--
fires when focus changes
@event focus
-->
<!--
Fires when value changes
@event change
-->
<input on:focus on:change /> |
I think on the js side, we have it quite covered. import { createEventDispatcher } from "svelte";
let fire = createEventDispatcher();
/**
* fires something
* */
fire("something");
/**
* fires something2
* */
fire("something2"); and it works pretty well. It's the HTML side thats causing problems. We can use multiple comment groups, but then it introduces a line-break between each block, which might not be ideal (for example Also in terms of parsing, we might have trouble trying to figure out how far up the template we should go to ensure we have all comment blocks. |
Actually, the most popular style of documentation writing of component/class behaviour that putting whole description at the top. So, for your case I think that it's OK if you profile documentation about markup fired events at the top of the component, as I provide at the first example of previous comment. And I support that support parsing of |
https://jsdoc.app/tags-event.html
The following comment must provide description for event and provide class of event
Markup documentation also must be valid for events
The text was updated successfully, but these errors were encountered: