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

Docs simple edits #5482

Closed
wants to merge 19 commits into from
Closed

Docs simple edits #5482

wants to merge 19 commits into from

Conversation

Zearin
Copy link
Contributor

@Zearin Zearin commented Nov 27, 2021

Changes:

This is a follow-up to my original efforts in Pull Request #5447. The main differences in this request are:

  • I tried to break up my edits into per-file commits
  • For any commits that went beyond simple formatting, I tried to summarize those edits in each commit
  • I tried to keep all my edits simpler to make review easier
  • I only worked my way through part of the reference docs (up through 📁dom/), to (hopefully) make it easier to review

If this works out, I’ll continue this line of work through the next chunk of reference docs and send another Pull Request.

PR Checklist

Also:
 * Use `—` instead of spaced hyphen-minus
 * Fix minor capitalization
 * Remove superflous `<br>`
 * Fixed some missing spaces after commas and periods
 * Use the serial (“Oxford”) comma
Also:
 * Fixed unnecessarily capitalized “The”
 * Include parentheses when referencing functions
 * Fix capitalization
 * Add paragraph break to `id()`
 * Add link to `dragLeave()`
Also:
 * Use escaped entities in HTML for comparison operators
 * Fix plural form in `for` loop
 * Add missing space after several periods
 * Add missing parentheses for functions
 * Add missing period at end of sentence for `noCanvas()`
 * Spaced the list items in `blendMod()` (since this is an unusually long block of HTML in the docstring)
 * Add serial (“Oxford”) comma in description of `mode` param of `blendMode()`
* Add serial (“Oxford”) comma where appropriate
 * Add paragraph break in description for `arc()`
 * Add paragraph break in description for `line()`
 * Remove superfluous comma after “The way these parameters are interpreted”
 * Lots of commas (especially for `strokeCap()`, where their absence made reading the description difficult)
 * Follow “Note” with a colon, not a comma
 * Fix mislabelled parameter in the description for `curveTightness()`
 * Add serial (“Oxford”) comma
 * Add paragraph breaks in `pop()` and `push()`
 * Minor edit to end of `p5()` docstring
Linkify references to functions.
 * Add links to references to Dictionary classes
 * Fix capitalization of params
 * Fix param descriptions using the param name itself as part of the description
Also:
 * Used `#exampleIdSelector, .exampleClassSelector` in descriptions
 * Add parentheses to referenced functions/methods
 * Fix some capitalization
 * Fix (some) param descriptions using the param name itself as part of the description
 * Add `&lt;` and `&gt;` around HTML tags to aid visual grepping HTML
 * Minor edits to param descriptions for input elements
 * Use punctuation to help the reader correctly parse the description of the `type` param for `createCapture()`
 * Add some paragraph breaks descriptions (usually between opening summary and subsequent descriptions of optional params
 * Change “current time” to `currentTime` to make it explicit that p5.js is using the `currentTime` DOM property
@welcome
Copy link

welcome bot commented Nov 27, 2021

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

@Zearin
Copy link
Contributor Author

Zearin commented Nov 27, 2021

@outofambit: Is this better than the last PR? It’s still a decent chunk of diffs—but I tried to keep the edits much simpler this time, and I only did a portion of the reference docs.

@Zearin
Copy link
Contributor Author

Zearin commented Dec 4, 2021

@Qianqianye: The docs list you as the other person in charge of the Reference docs. If @outofambit is busy, would you consider taking a look?

@Zearin Zearin mentioned this pull request Dec 11, 2021
2 tasks
* @param {Number|Constant} w width of the element, either AUTO, or a number
* @param {Number|Constant} [h] height of the element, either AUTO, or a number
* @param {Number|Constant} w width of the element, either a number, or `AUTO`
* @param {Number|Constant} [h] height of the element, either a number, or `AUTO`
Copy link
Member

Choose a reason for hiding this comment

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

This line and the line above cannot be changed because its structure is used to infer types in the documentation generation process. See more here.

@@ -10,7 +10,7 @@ import * as constants from '../core/constants';
/**
* Main graphics and rendering context, as well as the base API
* implementation for p5.js "core". To be used as the superclass for
* Renderer2D and Renderer3D classes, respectively.
* `Renderer2D` and `Renderer3D` classes, respectively.
Copy link
Member

Choose a reason for hiding this comment

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

Renderer3D should be RendererGL instead

@@ -113,8 +113,8 @@
*/

/**
* The greater than operator <a href="#/p5/>">></a>
* evaluates to true if the left value is greater than
* The greater than operator <a href="#/p5/>">&gt;</a>
Copy link
Member

Choose a reason for hiding this comment

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

The link doesn't work as the > in the URL should be encoded in this case.

Copy link
Member

Choose a reason for hiding this comment

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

Same for those below

* Searches the page for the first element that matches the given CSS selector string (can be an `#id`, a `.class`,
* a tag name, or a combination) and returns it as a <a href="#/p5.Element">p5.Element</a>.
* The DOM node itself can be accessed with `.elt`.
* Returns `null` if none found. You can also specify a `container` to search within.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure "container" here needs to be enclosed in code tags as it's not referencing a very specific item in this case.

Copy link
Member

Choose a reason for hiding this comment

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

Same for below.

@@ -451,13 +451,13 @@ p5.prototype.createA = function(href, html, target) {

/**
* Creates a slider `&lt;input&gt;&lt;/input&gt;` element in the DOM.
* Use .size() to set the display length of the slider.
* Use .`size()` to set the display length of the slider.
Copy link
Member

Choose a reason for hiding this comment

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

The dot before size() probably should be enclosed in backticks as well.

Copy link
Member

Choose a reason for hiding this comment

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

Same as below.

* @param {Function} callback callback function for when a file is loaded
* @param {Boolean} [multiple] optional, to allow multiple files to be selected
* @param {Function} callback Callback function to run when a file is loaded
* @param {Boolean} [multiple] (optional) Allow multiple files to be selected
Copy link
Member

Choose a reason for hiding this comment

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

"(optional)" is not required here as it is added automatically when the parameter is marked as so.

*
* @method hasClass
* @returns {boolean} a boolean value if element has specified class
* @param c {String} class name of class to check
* @param {String} c The `class` name to check
Copy link
Member

Choose a reason for hiding this comment

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

"class" don't need to be enclosed in code tag here, or the next one in the param tag below needs to be enclosed.

@Qianqianye
Copy link
Contributor

Thanks @Zearin for making the edits and @limzykenneth for making the suggestions. @Zearin, will you be able to make some new edits based on @limzykenneth's suggestion? Thank you!

@Zearin Zearin closed this Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants