Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve Accessibility Guidance fordescribe() 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
NalinDalal wants to merge19 commits intoprocessing:dev-2.0
base:dev-2.0
Choose a base branch
Loading
fromNalinDalal:dev-2.0
Open
Changes from1 commit
Commits
Show all changes
19 commits
Select commitHold shift + click to select a range
06019f3
Add fontWidth() and clarify textWidth vs fontWidth docs in attributes.js
NalinDalalSep 14, 2025
8f24e3e
Merge branch 'processing:dev-2.0' into dev-2.0
NalinDalalSep 18, 2025
0aaf553
updated as per maintainers comment, only documentation is updated
NalinDalalSep 18, 2025
486e2db
Add fontWidth() and clarify textWidth vs fontWidth docs in attributes…
NalinDalalSep 18, 2025
944779c
Merge branch 'processing:dev-2.0' into dev-2.0
NalinDalalSep 19, 2025
6633de2
aded docs for difference between textWidth and fontWidth with respect…
NalinDalalSep 19, 2025
eb58aba
unnecesaary file introduced, removed it, cleanedup the thing i was su…
NalinDalalSep 19, 2025
78ce6ac
Merge branch 'processing:dev-2.0' into dev-2.0
NalinDalalSep 22, 2025
2759e37
docs updated as asked
NalinDalalSep 22, 2025
3da06c0
removed things from previous pr
NalinDalalSep 23, 2025
f911702
i think done, if not will ask maintainer
NalinDalalSep 23, 2025
a0fae01
Merge branch 'dev-2.0' into dev-2.0
NalinDalalSep 24, 2025
b218819
check, merge conflicts
NalinDalalSep 24, 2025
cebc00c
Merge branch 'dev-2.0' into dev-2.0
NalinDalalSep 25, 2025
e2bd6b1
Merge branch 'dev-2.0' into dev-2.0
NalinDalalSep 29, 2025
8549b93
updated the docs as per suggesstion from perminder
NalinDalalOct 3, 2025
cf75292
Merge branch 'dev-2.0' of https://github.com/NalinDalal/p5.js into de…
NalinDalalOct 3, 2025
51534d6
Merge branch 'processing:dev-2.0' into dev-2.0
NalinDalalOct 9, 2025
74601d0
fixes as per review
NalinDalalOct 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
i think done, if not will ask maintainer
  • Loading branch information
@NalinDalal
NalinDalal committedSep 23, 2025
commitf911702ee8284e4bde031376ccd838070784d0a9

Some comments aren't visible on the classic Files Changed page.

68 changes: 25 additions & 43 deletionscontributor_docs/documentation_style_guide.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,6 +35,7 @@ Our community is large and diverse. Many people learn to code using p5.js, and a
- [Accessibility and Disability](#accessibility-and-disability)
- [Code Samples](#code-samples)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

These content needs to be present insideDocumentation Style Guide?
Screenshot from 2025-10-13 14-50-32

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.
For example,[Code Samples](#code-samples) appears both under the “Code/Documentation Style Guide” and again under the “Code” heading. Could you please clarify the reason for this duplication?

- [Comments](#comments)
- [Accessible Descriptions](#accessible-descriptions)
- [Whitespace](#whitespace)
- [Semicolons](#semicolons)
- [Naming Conventions](#naming-conventions)
Expand All@@ -50,7 +51,6 @@ Our community is large and diverse. Many people learn to code using p5.js, and a
- [Chaining](#chaining)
- [Classes](#classes)
- [Assets](#assets)
- [Canvas Accessibility Descriptions: `describe()`](#canvas-accessibility-descriptions-describe)

## YUIDoc

Expand DownExpand Up@@ -232,6 +232,29 @@ I will use // for multiline comments.

```


## 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
Expand DownExpand Up@@ -1224,52 +1247,11 @@ class Mover {

## Assets

## Canvas Accessibility Descriptions: `describe()`


`describe()` is one of the ways that p5.js sketches can be made accessible to screen readers. All contributions to the reference should include accessible canvas descriptions. For best practices, Do/Don’t examples, and summary guidance on writing effective `describe()` calls, see: [Documentation Style Guide: Canvas Accessibility Descriptions](./documentation_style_guide.md#canvas-accessibility-descriptions-describe).

This section provides more detailed guidance for contributors who want to ensure their examples are accessible:

- **Concise:** 1–3 sentences. Briefly describe what is visually present on the canvas.
- **Visual-Only:** Focus on what a sighted user would see. Do not describe code, instructions, or interactions unless they are visually represented.
- **Non-Redundant:** Avoid repeating information already available in the title or code comments.
- **Clarity:** Use simple, direct language. End with punctuation for screen reader clarity.

**Do/Don’t Examples:**

| Do | Don’t |
| --- | --- |
| `describe('A blue rectangle in the center of a white canvas.');` | `describe('This code draws a rectangle.');` |
| `describe('A red heart and yellow circle over a pink background.');` | `describe('Click to draw a heart.');` |
| `describe('A black dot moves from bottom to top on a gray square.');` | `describe('A shape.');` |

**More Guidance:**

- See the [Web Accessibility Contributor Doc](./web_accessibility.md#user-generated-accessible-canvas-descriptions) for technical details and examples.
- See the [Writing Accessible Canvas Descriptions tutorial](https://p5js.org/tutorials/writing-accessible-canvas-descriptions/) for more best practices and rationale.
- Reference examples must include a `describe()` call. See [Contributing to the p5.js Reference](./contributing_to_the_p5js_reference.md#add-a-canvas-description-using-describe) for details.


- 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".
Loading

[8]ページ先頭

©2009-2025 Movatter.jp