-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[docs] fix inline docs of windowResized and other event handler functions etc. #4988
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already. |
I don't quite understand this,
For me that's a bit too jargon-y especially using |
Thanks for the comment, just changed the PR to draft. |
So, sorry for confusing. First, what are described in the current documentation:
And what are common to all of these functions:
Given that, regarding what you mentioned: About the argument of
|
executeDefault = context.windowResized(e); | |
if (executeDefault !== undefined && !executeDefault) { | |
e.preventDefault(); | |
} |
So now I think that maybe I should stop adding the description about
return false
for windowResized()
.And I'm not sure whether the current implementation should be left as is.
Please let me know if there are any more concerns.
Wouldn't adding the The |
Re implementation of Re
Indeed it does, and yes, I understand your concern about the risk of confusing users. /**
* @return {*} false if any default behavior should be prevented for this event. (Optional)
*/ Or if I also thought of simply omitting the type, which is a valid YUIDoc and will also hide the Return field in the reference, however the contributor docs says "If there is no return type, do not include If it's still difficult to add |
However for the most part, accessibility of the reference will always take priority over machine-readability. If YUIDoc or typescript isn't able to support something like |
remove description about "return false" remove @param, @return tags (see processing#4988)
remove @return tags (see processing#4988)
remove @return tags (see processing#4988)
Sorry for being so late! And thank you for all of the comments above. Let's leave the return tag stuff as-is (for now) as it seems to be a little difficult to keep both human- and machine-readability in the current circumstances (even though they don't necessarily have to be exclusive; hope we can find any way to improve the documentation system in future). Updated the PR #4989. |
Most appropriate sub-area of p5.js?
My main intension is to supplement the machine-readable documentation that some other projects (such as p5.ts) rely on.
I've found some points to be fixed in the inline documentation.
Will be happy to create a pull request (not very familiar with it though; will read the contributor docs).
Description and arguments of
windowResized()
According to the actual code, the two below can be added:
return false
,same as other event handlers such as
mousePressed()
.Actually this can be any falsy value (while only
false
is valid in other event handlers), but maybe it's better to write it consistently with other event handler functions.@param {Object} [event]
,which is an
UIEvent
.(ADD: same for keyboard event handlers such as
keyPressed()
, which lack@param
tag even though they acceptKeyboardEvent
argument)Return type of
mousePressed()
and other event handlersmousePressed()
and other similar functions may return either void orboolean
.So I'd like to add something like:
Not sure if the type
{*}
is correct (it's also used inrandom()
with anArray
argument);In TypeScript it would be
any
orvoid | boolean
, and I suppose the latter cannot be described in YUIDoc.Arguments of
int()
(conversion function)Not really related to the above, but
@param {Integer} [radix]
is missing for the case if the first argument is anArray
.The text was updated successfully, but these errors were encountered: