p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

require `describe()` function in p5 sketches?

Open lmccart opened this issue 4 years ago • 12 comments
trafficstars

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 avatar Sep 24 '21 18:09 lmccart

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).

limzykenneth avatar Sep 24 '21 20:09 limzykenneth

@limzykenneth for the last part here, I think this is in progress, or has been started by @lm-n https://github.com/processing/p5.js/pull/5140

lmccart avatar Sep 29 '21 06:09 lmccart

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. :)

outofambit avatar Oct 01 '21 22:10 outofambit

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.

nickmcintyre avatar Oct 05 '21 15:10 nickmcintyre

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!

catarak avatar Oct 06 '21 18:10 catarak

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.

lmccart avatar Nov 03 '21 03:11 lmccart

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

nickmcintyre avatar Nov 03 '21 17:11 nickmcintyre

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.

catarak avatar Nov 03 '21 18:11 catarak

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

lm-n avatar Nov 03 '21 19:11 lm-n

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

outofambit avatar Nov 05 '21 19:11 outofambit

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

proxycase avatar Mar 11 '22 22:03 proxycase

@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.

limzykenneth avatar Mar 18 '22 16:03 limzykenneth