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

Edit docs for accessibility #6484

Merged
merged 4 commits into from
Nov 14, 2023
Merged

Conversation

nickmcintyre
Copy link
Member

Addresses #6483

Changes:
I edited the inline docs for describe(), describeElement(), textOutput(), and gridOutput() to bring them more in line with the style guide.

@dkessner, @MsQCompSci, @davepagurek, @limzykenneth, @Qianqianye, @katlich112358, @calebfoss, @cosmicbhejafry, @apoorva-a98, @tedkmburu, @Zarkv, @SkylerW99, @itsjoopark, @hannahvy, @nhasalajoshi I'd love to incorporate any feedback you may have! Here's a staging version of the edits in this pull request.

PR Checklist

  • npm run lint passes
  • [Inline documentation] is included / updated

@MsQCompSci
Copy link

In gridOutput the first example is missing the draw function like in the others. Maybe adding an example when gridOutput is used (instead of textOutput). It is also unclear to me, even after reading these docs, why someone would want to use textOutput over gridOutput, and vise versa.

@nickmcintyre
Copy link
Member Author

nickmcintyre commented Oct 24, 2023

@MsQCompSci thanks for pointing out the missing draw() function. Any example code that doesn't have setup() or draw() is placed inside setup() behind the scenes.

Should we generally use setup()? I revised the examples in this pull request to do so.

I updated the descriptions of gridOutput() and textOutput() to clarify when to use each. They also link to our new labeling guide. The staging version is updated. Let me know how these revisions look to you.

@davepagurek
Copy link
Contributor

Should we generally use setup()?

I think the examples that don't use setup/draw are useful for showing very concise examples without boilerplate potentially distracting from the concept, e.g. to show a number of examples with the different parameters for the same function without the page getting super long.

In general though, I think it's helpful having at least one example with the full boilerplate so that readers know what part of their sketch to add the function to. Maybe it would be most consistent to always do drawing in a draw call but use noLoop() in setup to indicate that it will just draw once? But it's also valid to do drawing in setup, so I think what you've got now is also ok.

@nickmcintyre nickmcintyre self-assigned this Nov 12, 2023
@nickmcintyre
Copy link
Member Author

@davepagurek @Qianqianye if these changes look good to you, please go ahead and merge them.

* background(220);
* background(200);
*
* let x = frameCount % 100;
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be helpful to add a comment here to explain what frameCount % 100 does in the code

* describe('green circle at x pos ' + round(x) + ' moving to the right');
* circle(x, 50, 40);
*
* describe('A green circle moves from left to right on a gray square. It restarts on the left edge after reaching the right edge.');
Copy link
Contributor

Choose a reason for hiding this comment

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

The original description shows that users can use variables like 'x' within describe(). I think it's helpful to show this use case. What do you think? @nickmcintyre

* <div>
* <code>
* let x = 0;
* function draw() {
* textOutput();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to show textOutput(LABEL) in one of the example snippets?

* <div>
* <code>
* let x = 0;
* function draw() {
* gridOutput();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to show the gridOutput(LABEL) usecase in one of the example snippets?

* fill(0, 0, 255);
* square(50, 50, 50);
*
* describe('A red circle and a blue square on a gray background.');
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to explain the use case of using both textOutput() and describe()?

@nickmcintyre
Copy link
Member Author

Great suggestions @Qianqianye. Please let me know how the latest revisions look.

@Qianqianye Qianqianye merged commit 92699ab into processing:main Nov 14, 2023
2 checks passed
@Qianqianye
Copy link
Contributor

Thanks @nickmcintyre, great work! I just merged it. Just to take a note for our backlog, some of labels in the example code are quite long, which takes up a lot of vertical space. We can revisit this after the web redesign phase.

@nickmcintyre nickmcintyre deleted the sod-accessibility branch May 6, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

5 participants