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

require describe() function in p5 sketches? #5427

Open
lmccart opened this issue Sep 24, 2021 · 12 comments
Open

require describe() function in p5 sketches? #5427

lmccart opened this issue Sep 24, 2021 · 12 comments

Comments

@lmccart
Copy link
Member

lmccart commented Sep 24, 2021

I was wondering what others think about the idea of potentially requiring a describe() line in order for a p5 sketch to run?

How would this new feature help [increase access]:

This would increase the accessibility of p5.js sketches for people that are Blind or have visual impairments. Considering the way p5.js use continues to expand in education, as well as other spaces like NFTs, this decision could potentially have a large impact.

It's important to note that this could potentially increase the barrier a bit for those that are new to p5.js. On the other hand, it could be a way to spread awareness, through teachers and documentation that teach what this function is and how to use it. The function itself is very straightforward to use.

As a less intense version of this, it could be that the sketch template includes a describe line, but doesn't require it to run.

Most appropriate sub-area of p5.js?

  • [ x ] Accessibility (Web Accessibility)
  • [ x ] Core/Environment/Rendering
@lmccart lmccart changed the title required describe() function? require describe() function in p5 sketches? Sep 24, 2021
@limzykenneth
Copy link
Member

I like the idea of nudging users towards including describe() in their sketch but at the same time I worry that making it mandatory for the sketch to run will remove the ability for the user to iterate and experiment with their code, especially without worrying that what is in describe() actually doesn't match what's on screen. I do feel having having somewhat accurate description to be important.

We can definitely go with including describe() in the template as well as in the online editor's default sketch. Another thing we can consider is logging a warning in the console when describe() is not included. A possible midway point would be only making describe() mandatory for the sketch to run when using the minified version (on the assumption that at that point, the sketch is ready to publish widely).

The way the reference examples adapt to this will need consideration as well. The examples should already have alt text added on rendering so they won't need to use describe() (which is also an alternative for the users who doesn't want to use describe() in the sketch code).

@lmccart
Copy link
Member Author

lmccart commented Sep 29, 2021

@limzykenneth for the last part here, I think this is in progress, or has been started by @lm-n #5140

@outofambit
Copy link
Contributor

100% agree on adding it to templates and the editor default template (cc @catarak if they want to comment)

I'd like to figure out a way to require or encourage using describe in p5 sketches. perhaps we could print an FES message when you run a sketch that doesn't call describe within setup or the first run of draw? That wouldn't add any barrier but it would remind and encourage folks to use the functionality.

I'm not opposed to halting the sketch if describe isn't called in setup, but this would likely mean that a large number of existing sketches would break when they upgraded to a later version of p5.js. We can do that, I'd just want to be thoughtful about how we roll it out. This could be the kind of thing we make a warning soon and then eventually make a strict requirement in a 2.0 release.

Curious to hear others' thoughts! Thanks for having this conversation. :)

@nickmcintyre
Copy link
Member

I'm all for nudging folks to make their work more accessible and including describe() in templates. This feature would probably lead to some great conversations with younger students -- might be helpful to prepare simple discussion guides for teachers.

My initial take is to encourage the use of describe() through FES messages. Transitioning to a requirement in a 2.0 release would also give time to gather feedback from people's experience using the function regularly.

Side note, I believe the reference for describe() is broken so I opened an issue.

@catarak
Copy link
Member

catarak commented Oct 6, 2021

I think it's a great idea to add describe() to the default sketch in the web editor! I also think it's a good idea to nudge users to use describe() via friendly errors, and perhaps this message could link to a guide for how to write good descriptions.

Another way to encourage folks to use describe() would be to add it to all of the existing p5.js examples. I couldn't find an open issue about this and I'm happy to create it!

@lmccart
Copy link
Member Author

lmccart commented Nov 3, 2021

Just following up on this... would you all be open to receiving PRs that add the describe() line into the example templates and possibly into the FES, too? I'm happy to put something together if it's of interest.

@nickmcintyre
Copy link
Member

Certainly! Happy to help with this effort given a little direction.

@catarak
Copy link
Member

catarak commented Nov 3, 2021

Just following up on this... would you all be open to receiving PRs that add the describe() line into the example templates and possibly into the FES, too? I'm happy to put something together if it's of interest.

Absolutely! I'll create an issue in the editor repository.

@lm-n
Copy link
Member

lm-n commented Nov 3, 2021

This is all super exciting ❤️ ❤️ ❤️ I'm a bit overwhelmed rn to implement any changes but happy to chat or review code. 🙇 🙏 🙇 🙏 🙇

@outofambit
Copy link
Contributor

would you all be open to receiving PRs that add the describe() line into the example templates and possibly into the FES, too?

i would, yes! :D

Zearin added a commit to Zearin/p5.js that referenced this issue Jan 22, 2022
**Summary:**
- This commit converts all the uses of `@alt` I found in 📁`src/color`.
- Since `@alt` was not linted for line length while `describe(…)` is, I had to add line breaks to the descriptions for the lint to pass (and allow the commit to go through).

**Related Issues & Pull Requests:**

- This is a small piece of the checklist described in Issue processing#5139 (by @lm-n).
- That issue, in turn, was begun in Pull Request processing#5140 (also by @lm-n).
- In Issue processing#5427, the idea requiring this for the inline docs got positive support from several members (including @lmccart, @outofambit, and @catarak).
@proxycase
Copy link

Are there linter setups available for p5js? For example, eslint in one of my projects will warn me immediately if I don't have an alt tag on my img elements

@limzykenneth
Copy link
Member

@proxycase If it is possible to somehow enforce this using eslint we can include a default .eslintrc file in the p5.js-complete download with such a rule. Although I don't know enough about custom eslint rule to say whether this is even possible or not.

@Qianqianye Qianqianye added this to the 1.5.0 milestone Jul 27, 2022
@Qianqianye Qianqianye modified the milestones: 1.8.0, 1.9.0 Nov 23, 2023
@Qianqianye Qianqianye modified the milestones: 1.9.0, 1.9.1 Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants