-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Improve Accessibility Guidance for describe() Usage
#8101
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
base: dev-2.0
Are you sure you want to change the base?
Changes from 11 commits
06019f3
8f24e3e
0aaf553
486e2db
944779c
6633de2
eb58aba
78ce6ac
2759e37
3da06c0
f911702
a0fae01
b218819
cebc00c
e2bd6b1
8549b93
cf75292
51534d6
74601d0
7cc2d8b
1ef5b37
84ee41e
493ceed
30d45e8
95a02d7
e8ae5d1
218313c
e10f7d0
6a2e30b
3dea4a1
0f90b46
2b0ead8
dd4afcb
86a3f24
d1b961c
0c0e5c8
cb89f1e
907cb87
d3e7e7a
8e60de2
3b9f224
f0b012f
bcd8324
b01a556
ed84b40
2ba8f22
b082995
fd71a5d
a9fac53
26dd043
c15d11a
89f8bad
a8cd5db
73841a3
aef34ea
68e6ff2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,23 +23,34 @@ Our community is large and diverse. Many people learn to code using p5.js, and a | |
| - [Accessibility and Disability](#accessibility-and-disability) | ||
|
|
||
| ### Code | ||
| - [Code Samples](#code-samples) | ||
| - [Comments](#comments) | ||
| - [Whitespace](#whitespace) | ||
| - [Semicolons](#semicolons) | ||
| - [Naming Conventions](#naming-conventions) | ||
| - [Variables](#variables) | ||
| - [Strings](#strings) | ||
| - [Boolean Operators](#boolean-operators) | ||
| - [Conditionals](#conditionals) | ||
| - [Iteration](#iteration) | ||
| - [Objects](#objects) | ||
| - [Arrays](#arrays) | ||
| - [Functions](#functions) | ||
| - [Arrow Functions](#arrow-functions) | ||
| - [Chaining](#chaining) | ||
| - [Classes](#classes) | ||
| - [Assets](#assets) | ||
| - [Documentation Style Guide](#documentation-style-guide) | ||
| - [Table of Contents](#table-of-contents) | ||
| - [Writing](#writing) | ||
| - [Code](#code) | ||
| - [YUIDoc](#yuidoc) | ||
| - [English](#english) | ||
| - [Oxford Comma](#oxford-comma) | ||
| - [Wording](#wording) | ||
| - [Unbiased Documentation](#unbiased-documentation) | ||
| - [Accessibility and Disability](#accessibility-and-disability) | ||
| - [Code Samples](#code-samples) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These content needs to be present inside I’m not quite sure why it’s being added again under the “Documentation Style Guide” section, and then repeated inside the code section below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi again, I think I don't understand this part? Can you please clarify this one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for the followup on this again? Can you clarify this? Not asking for any changes, but just for my clarification? |
||
| - [Comments](#comments) | ||
| - [Accessible Descriptions](#accessible-descriptions) | ||
| - [Whitespace](#whitespace) | ||
| - [Semicolons](#semicolons) | ||
| - [Naming Conventions](#naming-conventions) | ||
| - [Variables](#variables) | ||
| - [Strings](#strings) | ||
| - [Boolean Operators](#boolean-operators) | ||
| - [Conditionals](#conditionals) | ||
| - [Iteration](#iteration) | ||
| - [Objects](#objects) | ||
| - [Arrays](#arrays) | ||
| - [Functions](#functions) | ||
| - [Arrow Functions](#arrow-functions) | ||
| - [Chaining](#chaining) | ||
| - [Classes](#classes) | ||
| - [Assets](#assets) | ||
|
|
||
| ## YUIDoc | ||
|
|
||
|
|
@@ -165,7 +176,7 @@ Choose meaningful code samples that cover the basics as well as gotchas. Only us | |
|
|
||
| ```javascript | ||
| // Bad. | ||
| let magicWord = 'Please'; // Remember this. | ||
| let magicWord = 'Please'; //Remember this. | ||
|
|
||
| // Good. | ||
| // Remember this. | ||
|
|
@@ -174,7 +185,7 @@ let magicWord = 'Please'; | |
| // Bad. | ||
| if (keyIsPressed === true) { | ||
| thing1(); | ||
| // This is an important note. | ||
| //This is an important note. | ||
| thing2(); | ||
| } | ||
|
|
||
|
|
@@ -204,22 +215,13 @@ let magicWord = 'Please'; | |
| ```javascript | ||
|
|
||
| // Bad. | ||
| /** | ||
| * I will use // for multiline comments. | ||
| * I will use // for multiline comments. | ||
| * I will use // for multiline comments. | ||
| * I will use // for multiline comments. | ||
| * I will use // for multiline comments. | ||
| */ | ||
|
|
||
| //Bad. | ||
| /* | ||
| I will use // for multiline comments. | ||
| I will use // for multiline comments. | ||
| I will use // for multiline comments. | ||
| I will use // for multiline comments. | ||
| I will use // for multiline comments. | ||
| */ | ||
| I will use // for multiline comments. | ||
| I will use // for multiline comments. | ||
| I will use // for multiline comments. | ||
| I will use // for multiline comments. | ||
| I will use // for multiline comments. | ||
| */ | ||
|
|
||
| // Good. | ||
| // I will use // for multiline comments. | ||
|
|
@@ -230,6 +232,29 @@ let magicWord = 'Please'; | |
|
|
||
| ``` | ||
|
|
||
|
|
||
| ## Accessible Descriptions | ||
|
|
||
| - Use `describe()` to make p5.js sketches accessible to screen readers. All reference contributions should include a concise, visual canvas description for accessibility. | ||
|
|
||
| - **Concise:** 1–3 sentences. Briefly describe what is visually present on the canvas. | ||
| - Good: `describe('A blue rectangle in the center of a white canvas.');` | ||
| - Bad: `describe('This code draws a rectangle.');` | ||
|
|
||
| - **Visual-Only:** Focus on what a sighted user would see. Do not describe code, instructions, or interactions unless they are visually represented. | ||
| - Good: `describe('A red heart and yellow circle over a pink background.');` | ||
| - Bad: `describe('Click to draw a heart.');` | ||
|
|
||
| - **Non-Redundant:** Avoid repeating information already available in the title or code comments. | ||
| - Good: `describe('A black dot moves from bottom to top on a gray square.');` | ||
| - Bad: `describe('A shape.');` | ||
|
|
||
| - **Clarity:** Use simple, direct language. End with punctuation for screen reader clarity. | ||
| - Good: `describe('A green triangle on a white background.');` | ||
| - Bad: `describe('triangle');` | ||
|
|
||
| New to writing accessible canvas descriptions? Please check the [Web Accessibility Contributor Doc](./web_accessibility.md#user-generated-accessible-canvas-descriptions) and [Writing Accessible Canvas Descriptions tutorial](https://p5js.org/tutorials/writing-accessible-canvas-descriptions/) next. | ||
|
|
||
| **[⬆ back to top](#table-of-contents)** | ||
|
|
||
| ## Whitespace | ||
|
|
@@ -1222,25 +1247,11 @@ class Mover { | |
|
|
||
| ## Assets | ||
|
|
||
| - Always load assets from a folder called "assets". | ||
|
|
||
| > Why? It models good project organization. It's also required for assets to load on the p5.js website. Place assets in the following folders to include them in our online documentation: | ||
| - Examples: [src/data/examples/assets](https://github.com/processing/p5.js-website/tree/main/src/data/examples) | ||
| - Reference Pages: [src/templates/pages/reference/assets](https://github.com/processing/p5.js-website/tree/main/src/templates/pages/reference/assets) | ||
| - Learn Pages: [src/assets/learn](https://github.com/processing/p5.js-website/tree/main/src/assets/learn) | ||
|
|
||
| ```javascript | ||
| let img; | ||
|
|
||
| // Bad. | ||
| function preload() { | ||
| img = loadImage('moonwalk.jpg'); | ||
| } | ||
|
|
||
| // Good. | ||
| function preload() { | ||
| img = loadImage('assets/moonwalk.jpg'); | ||
| } | ||
| ``` | ||
|
|
||
| **[⬆ back to top](#table-of-contents)** | ||
| Always load assets from a folder called "assets". | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -242,6 +242,8 @@ When creating screen reader-accessible outputs, naming the colors used in the ca | |
|
|
||
| ### describe() | ||
|
|
||
| **See also:** [Documentation Style Guide: Canvas Accessibility Descriptions](./documentation_style_guide.md#canvas-accessibility-descriptions-describe) for best practices, Do/Don’t examples, and summary guidance on writing effective `describe()` calls. | ||
|
||
|
|
||
| The `describe()` function creates a sketch author-defined screen reader accessible description for the canvas. The first parameter should be a string with a description of the canvas. The second parameter is optional. If specified, it determines how the description is displayed. If a user passes `LABEL` as a second parameter, an additional `<div>` element is created next to the `<canvas>` element. The new `<div>` element contains a visible version of the same screen reader-accessible description embedded in the `<canvas>` element. | ||
|
|
||
| `describe()` is supported by several methods in [src/accessibility/describe.js](https://github.com/processing/p5.js/blob/main/src/accessibility/describe.js): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2731,4 +2731,4 @@ export default textCore; | |
|
|
||
| if (typeof p5 !== 'undefined') { | ||
| textCore(p5, p5.prototype); | ||
| } | ||
| } | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link won't work now because you removed this section on your latest commit?