From 526fd3c0b802199b8db816ff88378baa9e8a9af0 Mon Sep 17 00:00:00 2001 From: Zearin Date: Sun, 6 Feb 2022 21:49:38 -0500 Subject: [PATCH 01/11] docs(src/utilities): Use `describe()` instead of `@alt` Address #5139 --- src/utilities/string_functions.js | 39 ++++++++++++------------------- src/utilities/time_date.js | 29 +++++++---------------- 2 files changed, 23 insertions(+), 45 deletions(-) diff --git a/src/utilities/string_functions.js b/src/utilities/string_functions.js index 155a1deeff..491d0f9c75 100644 --- a/src/utilities/string_functions.js +++ b/src/utilities/string_functions.js @@ -29,11 +29,9 @@ import '../core/friendly_errors/fes_core'; * let separator = ' '; * let message = join(array, separator); * text(message, 5, 50); + * describe(`“hello world!” displayed middle left of canvas.`); * * - * - * @alt - * "hello world!" displayed middle left of canvas. */ p5.prototype.join = function(list, separator) { p5._validateParameters('join', arguments); @@ -69,11 +67,9 @@ p5.prototype.join = function(list, separator) { * let regexp = 'p5js\\*'; * let m = match(string, regexp); * text(m, 5, 50); + * describe(`“p5js*” displayed middle left of canvas.`); * * - * - * @alt - * "p5js*" displayed middle left of canvas. */ p5.prototype.match = function(str, reg) { p5._validateParameters('match', arguments); @@ -166,12 +162,11 @@ p5.prototype.matchAll = function(str, reg) { * // Draw dividing line * stroke(120); * line(0, 50, width, 50); + * + * describe(`“0321.00” middle top, “-1321.00” middle bottom canvas`); * } * * - * - * @alt - * "0321.00" middle top, -1321.00" middle bottom canvas */ /** * @method nf @@ -265,12 +260,12 @@ function doNf(num, left, right) { * // Draw dividing line * stroke(120); * line(0, 50, width, 50); + * + * describe(`“11,253,106.115” top middle and + * “1.00,1.00,2.00” displayed bottom mid`); * } * * - * - * @alt - * "11,253,106.115" top middle and "1.00,1.00,2.00" displayed bottom mid */ /** * @method nfc @@ -342,12 +337,12 @@ function doNfc(num, right) { * // Draw dividing line * stroke(120); * line(0, 50, width, 50); + * + * describe(`“+11253106.11” top middle and + * “-11253106.11” displayed bottom middle`); * } * * - * - * @alt - * "+11253106.11" top middle and "-11253106.11" displayed bottom middle */ /** * @method nfp @@ -420,12 +415,11 @@ function addNfp(num) { * // Draw dividing line * stroke(120); * line(0, 50, width, 50); + * + * describe(`“0321.00” top middle and “-1321.00” displayed bottom middle`); * } * * - * - * @alt - * "0321.00" top middle and "-1321.00" displayed bottom middle */ /** * @method nfs @@ -470,11 +464,10 @@ function addNfs(num) { * text(splitString[0], 5, 30); * text(splitString[1], 5, 50); * text(splitString[2], 5, 70); + * describe(`“pat” top left, “Xio” mid left, and + * “Alex” displayed bottom left`); * * - * - * @alt - * "pat" top left, "Xio" mid left and "Alex" displayed bottom left */ p5.prototype.split = function(str, delim) { p5._validateParameters('split', arguments); @@ -548,11 +541,9 @@ p5.prototype.splitTokens = function(value, delims) { * * let string = trim(' No new lines\n '); * text(string + ' here', 2, 50); + * describe(`“No new lines here” displayed center canvas`); * * - * - * @alt - * "No new lines here" displayed center canvas */ /** * @method trim diff --git a/src/utilities/time_date.js b/src/utilities/time_date.js index 62f752bc92..e891512ca6 100644 --- a/src/utilities/time_date.js +++ b/src/utilities/time_date.js @@ -18,11 +18,9 @@ import p5 from '../core/main'; * * let d = day(); * text('Current day: \n' + d, 5, 50); + * describe(`Current day is displayed`); * * - * - * @alt - * Current day is displayed */ p5.prototype.day = function() { return new Date().getDate(); @@ -39,11 +37,9 @@ p5.prototype.day = function() { * * let h = hour(); * text('Current hour:\n' + h, 5, 50); + * describe(`Current hour is displayed`); * * - * - * @alt - * Current hour is displayed */ p5.prototype.hour = function() { return new Date().getHours(); @@ -60,11 +56,9 @@ p5.prototype.hour = function() { * * let m = minute(); * text('Current minute: \n' + m, 5, 50); + * describe(`Current minute is displayed`); * * - * - * @alt - * Current minute is displayed */ p5.prototype.minute = function() { return new Date().getMinutes(); @@ -82,11 +76,10 @@ p5.prototype.minute = function() { * * let millisecond = millis(); * text('Milliseconds \nrunning: \n' + millisecond, 5, 40); + * describe(`number of milliseconds since sketch has started + * displayed`); * * - * - * @alt - * number of milliseconds since sketch has started displayed */ p5.prototype.millis = function() { if (this._millisStart === -1) { @@ -108,11 +101,9 @@ p5.prototype.millis = function() { * * let m = month(); * text('Current month: \n' + m, 5, 50); + * describe(`Current month is displayed`); * * - * - * @alt - * Current month is displayed */ p5.prototype.month = function() { //January is 0! @@ -130,11 +121,9 @@ p5.prototype.month = function() { * * let s = second(); * text('Current second: \n' + s, 5, 50); + * describe(`Current second is displayed`); * * - * - * @alt - * Current second is displayed */ p5.prototype.second = function() { return new Date().getSeconds(); @@ -151,11 +140,9 @@ p5.prototype.second = function() { * * let y = year(); * text('Current year: \n' + y, 5, 50); + * describe(`Current year is displayed`); * * - * - * @alt - * Current year is displayed */ p5.prototype.year = function() { return new Date().getFullYear(); From 8e790dba4259eee2ea114133364f357d8ab11339 Mon Sep 17 00:00:00 2001 From: Zearin Date: Mon, 7 Feb 2022 15:08:15 -0500 Subject: [PATCH 02/11] docs(src/utilities): Missed one `describe()`... Addresses #5139 --- src/utilities/conversion.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utilities/conversion.js b/src/utilities/conversion.js index b640b4bd53..c33bd2c4c8 100644 --- a/src/utilities/conversion.js +++ b/src/utilities/conversion.js @@ -24,15 +24,13 @@ import p5 from '../core/main'; * let str = '20'; * let diameter = float(str); * ellipse(width / 2, height / 2, diameter, diameter); + * describe(`20×20 white ellipse in the center of the canvas`); * *
* print(float('10.31')); // 10.31 * print(float('Infinity')); // Infinity * print(float('-Infinity')); // -Infinity *
- * - * @alt - * 20 by 20 white ellipse in the center of the canvas */ p5.prototype.float = function(str) { if (str instanceof Array) { From 98d0d1b8c12b49a06609a91794e75e55b90bb3c1 Mon Sep 17 00:00:00 2001 From: Zearin Date: Sat, 26 Feb 2022 10:41:34 -0500 Subject: [PATCH 03/11] =?UTF-8?q?docs(src/utilities):=20Replace=20?= =?UTF-8?q?=E2=80=9C=C3=97=E2=80=9D=20for=20screen=20readers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utilities/conversion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/conversion.js b/src/utilities/conversion.js index c33bd2c4c8..5d6a2143a7 100644 --- a/src/utilities/conversion.js +++ b/src/utilities/conversion.js @@ -24,7 +24,7 @@ import p5 from '../core/main'; * let str = '20'; * let diameter = float(str); * ellipse(width / 2, height / 2, diameter, diameter); - * describe(`20×20 white ellipse in the center of the canvas`); + * describe(`20-by-20 white ellipse in the center of the canvas`); * *
* print(float('10.31')); // 10.31 From 2710fdfc663fac57be7b30b7e67cb6f1d6a64ea9 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 21 Aug 2023 17:30:42 -0700 Subject: [PATCH 04/11] Fix typo in string_functions.js --- src/utilities/string_functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/string_functions.js b/src/utilities/string_functions.js index 491d0f9c75..8d478a45a0 100644 --- a/src/utilities/string_functions.js +++ b/src/utilities/string_functions.js @@ -29,7 +29,7 @@ import '../core/friendly_errors/fes_core'; * let separator = ' '; * let message = join(array, separator); * text(message, 5, 50); - * describe(`“hello world!” displayed middle left of canvas.`); + * describe(`“Hello world!” displayed middle left of canvas.`); * *
*/ From 7433e96159b766af737d64eeec5f0f9874531c71 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 21 Aug 2023 17:38:16 -0700 Subject: [PATCH 05/11] Update strings with single quote --- src/utilities/string_functions.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utilities/string_functions.js b/src/utilities/string_functions.js index 8d478a45a0..8f4326d6ea 100644 --- a/src/utilities/string_functions.js +++ b/src/utilities/string_functions.js @@ -29,7 +29,7 @@ import '../core/friendly_errors/fes_core'; * let separator = ' '; * let message = join(array, separator); * text(message, 5, 50); - * describe(`“Hello world!” displayed middle left of canvas.`); + * describe(`'Hello world!' displayed middle left of canvas.`); * * */ @@ -67,7 +67,7 @@ p5.prototype.join = function(list, separator) { * let regexp = 'p5js\\*'; * let m = match(string, regexp); * text(m, 5, 50); - * describe(`“p5js*” displayed middle left of canvas.`); + * describe(`'p5js*' displayed middle left of canvas.`); * * */ @@ -163,7 +163,7 @@ p5.prototype.matchAll = function(str, reg) { * stroke(120); * line(0, 50, width, 50); * - * describe(`“0321.00” middle top, “-1321.00” middle bottom canvas`); + * describe(`'0321.00' middle top, '-1321.00' middle bottom canvas`); * } * * @@ -261,8 +261,8 @@ function doNf(num, left, right) { * stroke(120); * line(0, 50, width, 50); * - * describe(`“11,253,106.115” top middle and - * “1.00,1.00,2.00” displayed bottom mid`); + * describe(`'11,253,106.115' top middle and + * '1.00,1.00,2.00' displayed bottom mid`); * } * * @@ -338,8 +338,8 @@ function doNfc(num, right) { * stroke(120); * line(0, 50, width, 50); * - * describe(`“+11253106.11” top middle and - * “-11253106.11” displayed bottom middle`); + * describe(`'+11253106.11' top middle and + * '-11253106.11' displayed bottom middle`); * } * * @@ -416,7 +416,7 @@ function addNfp(num) { * stroke(120); * line(0, 50, width, 50); * - * describe(`“0321.00” top middle and “-1321.00” displayed bottom middle`); + * describe(`'0321.00' top middle and '-1321.00' displayed bottom middle`); * } * * @@ -464,7 +464,7 @@ function addNfs(num) { * text(splitString[0], 5, 30); * text(splitString[1], 5, 50); * text(splitString[2], 5, 70); - * describe(`“pat” top left, “Xio” mid left, and + * describe(`'pat' top left, 'Xio' mid left, and * “Alex” displayed bottom left`); * * @@ -541,7 +541,7 @@ p5.prototype.splitTokens = function(value, delims) { * * let string = trim(' No new lines\n '); * text(string + ' here', 2, 50); - * describe(`“No new lines here” displayed center canvas`); + * describe(`'No new lines here' displayed center canvas`); * * */ From 862ea69ff770480a4d55815d232d7c61b6d70a91 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 21 Aug 2023 17:52:37 -0700 Subject: [PATCH 06/11] Update single quote --- src/utilities/conversion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/conversion.js b/src/utilities/conversion.js index 5d6a2143a7..983d7ce61b 100644 --- a/src/utilities/conversion.js +++ b/src/utilities/conversion.js @@ -24,7 +24,7 @@ import p5 from '../core/main'; * let str = '20'; * let diameter = float(str); * ellipse(width / 2, height / 2, diameter, diameter); - * describe(`20-by-20 white ellipse in the center of the canvas`); + * describe('20-by-20 white ellipse in the center of the canvas'); * *
* print(float('10.31')); // 10.31 From be9f2227232ee12f42471b95ab4f057c6db159fe Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 21 Aug 2023 17:55:29 -0700 Subject: [PATCH 07/11] Update single quote in string_functions.js --- src/utilities/string_functions.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/utilities/string_functions.js b/src/utilities/string_functions.js index 8f4326d6ea..3969fab6bc 100644 --- a/src/utilities/string_functions.js +++ b/src/utilities/string_functions.js @@ -29,7 +29,7 @@ import '../core/friendly_errors/fes_core'; * let separator = ' '; * let message = join(array, separator); * text(message, 5, 50); - * describe(`'Hello world!' displayed middle left of canvas.`); + * describe(''Hello world!' displayed middle left of canvas.'); * *
*/ @@ -67,7 +67,7 @@ p5.prototype.join = function(list, separator) { * let regexp = 'p5js\\*'; * let m = match(string, regexp); * text(m, 5, 50); - * describe(`'p5js*' displayed middle left of canvas.`); + * describe(''p5js*' displayed middle left of canvas.'); * * */ @@ -163,7 +163,7 @@ p5.prototype.matchAll = function(str, reg) { * stroke(120); * line(0, 50, width, 50); * - * describe(`'0321.00' middle top, '-1321.00' middle bottom canvas`); + * describe(''0321.00' middle top, '-1321.00' middle bottom canvas'); * } * * @@ -261,8 +261,8 @@ function doNf(num, left, right) { * stroke(120); * line(0, 50, width, 50); * - * describe(`'11,253,106.115' top middle and - * '1.00,1.00,2.00' displayed bottom mid`); + * describe(''11,253,106.115' top middle and + * '1.00,1.00,2.00' displayed bottom mid'); * } * * @@ -338,8 +338,8 @@ function doNfc(num, right) { * stroke(120); * line(0, 50, width, 50); * - * describe(`'+11253106.11' top middle and - * '-11253106.11' displayed bottom middle`); + * describe(''+11253106.11' top middle and + * '-11253106.11' displayed bottom middle'); * } * * @@ -416,7 +416,7 @@ function addNfp(num) { * stroke(120); * line(0, 50, width, 50); * - * describe(`'0321.00' top middle and '-1321.00' displayed bottom middle`); + * describe(''0321.00' top middle and '-1321.00' displayed bottom middle'); * } * * @@ -464,8 +464,8 @@ function addNfs(num) { * text(splitString[0], 5, 30); * text(splitString[1], 5, 50); * text(splitString[2], 5, 70); - * describe(`'pat' top left, 'Xio' mid left, and - * “Alex” displayed bottom left`); + * describe(''pat' top left, 'Xio' mid left, and + * “Alex” displayed bottom left'); * * */ @@ -541,7 +541,7 @@ p5.prototype.splitTokens = function(value, delims) { * * let string = trim(' No new lines\n '); * text(string + ' here', 2, 50); - * describe(`'No new lines here' displayed center canvas`); + * describe(''No new lines here' displayed center canvas'); * * */ From 6dbde4c20e0d3373b72393202999bdbb597b0ca3 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 21 Aug 2023 18:04:51 -0700 Subject: [PATCH 08/11] Update string_functions.js --- src/utilities/string_functions.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utilities/string_functions.js b/src/utilities/string_functions.js index 3969fab6bc..31f22fb6fd 100644 --- a/src/utilities/string_functions.js +++ b/src/utilities/string_functions.js @@ -29,7 +29,7 @@ import '../core/friendly_errors/fes_core'; * let separator = ' '; * let message = join(array, separator); * text(message, 5, 50); - * describe(''Hello world!' displayed middle left of canvas.'); + * describe('“Hello world!” displayed middle left of canvas.'); * * */ @@ -67,7 +67,7 @@ p5.prototype.join = function(list, separator) { * let regexp = 'p5js\\*'; * let m = match(string, regexp); * text(m, 5, 50); - * describe(''p5js*' displayed middle left of canvas.'); + * describe('“p5js*” displayed middle left of canvas.'); * * */ @@ -163,7 +163,7 @@ p5.prototype.matchAll = function(str, reg) { * stroke(120); * line(0, 50, width, 50); * - * describe(''0321.00' middle top, '-1321.00' middle bottom canvas'); + * describe('“0321.00” middle top, “-1321.00” middle bottom canvas'); * } * * @@ -261,8 +261,8 @@ function doNf(num, left, right) { * stroke(120); * line(0, 50, width, 50); * - * describe(''11,253,106.115' top middle and - * '1.00,1.00,2.00' displayed bottom mid'); + * describe('“11,253,106.115” top middle and + * “1.00,1.00,2.00” displayed bottom mid'); * } * * @@ -338,8 +338,8 @@ function doNfc(num, right) { * stroke(120); * line(0, 50, width, 50); * - * describe(''+11253106.11' top middle and - * '-11253106.11' displayed bottom middle'); + * describe('“+11253106.11” top middle and + * “-11253106.11” displayed bottom middle'); * } * * @@ -416,7 +416,7 @@ function addNfp(num) { * stroke(120); * line(0, 50, width, 50); * - * describe(''0321.00' top middle and '-1321.00' displayed bottom middle'); + * describe('“0321.00” top middle and “-1321.00” displayed bottom middle'); * } * * @@ -464,7 +464,7 @@ function addNfs(num) { * text(splitString[0], 5, 30); * text(splitString[1], 5, 50); * text(splitString[2], 5, 70); - * describe(''pat' top left, 'Xio' mid left, and + * describe('“pat” top left, “Xio” mid left, and * “Alex” displayed bottom left'); * * @@ -541,7 +541,7 @@ p5.prototype.splitTokens = function(value, delims) { * * let string = trim(' No new lines\n '); * text(string + ' here', 2, 50); - * describe(''No new lines here' displayed center canvas'); + * describe('“No new lines here” displayed center canvas'); * * */ From 2138daeaeda51a85b6c8c9eb4969bb032b645a03 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 21 Aug 2023 18:06:31 -0700 Subject: [PATCH 09/11] Update time_date.js --- src/utilities/time_date.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utilities/time_date.js b/src/utilities/time_date.js index e891512ca6..731b3fb66d 100644 --- a/src/utilities/time_date.js +++ b/src/utilities/time_date.js @@ -18,7 +18,7 @@ import p5 from '../core/main'; * * let d = day(); * text('Current day: \n' + d, 5, 50); - * describe(`Current day is displayed`); + * describe('Current day is displayed'); * * */ @@ -37,7 +37,7 @@ p5.prototype.day = function() { * * let h = hour(); * text('Current hour:\n' + h, 5, 50); - * describe(`Current hour is displayed`); + * describe('Current hour is displayed'); * * */ @@ -56,7 +56,7 @@ p5.prototype.hour = function() { * * let m = minute(); * text('Current minute: \n' + m, 5, 50); - * describe(`Current minute is displayed`); + * describe('Current minute is displayed'); * * */ @@ -76,8 +76,8 @@ p5.prototype.minute = function() { * * let millisecond = millis(); * text('Milliseconds \nrunning: \n' + millisecond, 5, 40); - * describe(`number of milliseconds since sketch has started - * displayed`); + * describe('number of milliseconds since sketch has started + * displayed'); * * */ @@ -101,7 +101,7 @@ p5.prototype.millis = function() { * * let m = month(); * text('Current month: \n' + m, 5, 50); - * describe(`Current month is displayed`); + * describe('Current month is displayed'); * * */ @@ -121,7 +121,7 @@ p5.prototype.month = function() { * * let s = second(); * text('Current second: \n' + s, 5, 50); - * describe(`Current second is displayed`); + * describe('Current second is displayed'); * * */ @@ -140,7 +140,7 @@ p5.prototype.second = function() { * * let y = year(); * text('Current year: \n' + y, 5, 50); - * describe(`Current year is displayed`); + * describe('Current year is displayed'); * * */ From e76aacf6e326519e22b3042d751922cb102876f6 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 21 Aug 2023 18:12:24 -0700 Subject: [PATCH 10/11] Update time_date.js --- src/utilities/time_date.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utilities/time_date.js b/src/utilities/time_date.js index 731b3fb66d..827682bd30 100644 --- a/src/utilities/time_date.js +++ b/src/utilities/time_date.js @@ -76,8 +76,7 @@ p5.prototype.minute = function() { * * let millisecond = millis(); * text('Milliseconds \nrunning: \n' + millisecond, 5, 40); - * describe('number of milliseconds since sketch has started - * displayed'); + * describe('number of milliseconds since sketch has started displayed'); * * */ From 440ca423178ad7e4bb3eab432f0863d9ff828712 Mon Sep 17 00:00:00 2001 From: Qianqian Ye Date: Mon, 21 Aug 2023 18:14:36 -0700 Subject: [PATCH 11/11] Update string_functions.js --- src/utilities/string_functions.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/utilities/string_functions.js b/src/utilities/string_functions.js index 31f22fb6fd..5464785a06 100644 --- a/src/utilities/string_functions.js +++ b/src/utilities/string_functions.js @@ -261,8 +261,7 @@ function doNf(num, left, right) { * stroke(120); * line(0, 50, width, 50); * - * describe('“11,253,106.115” top middle and - * “1.00,1.00,2.00” displayed bottom mid'); + * describe('“11,253,106.115” top middle and “1.00,1.00,2.00” displayed bottom mid'); * } * * @@ -338,8 +337,7 @@ function doNfc(num, right) { * stroke(120); * line(0, 50, width, 50); * - * describe('“+11253106.11” top middle and - * “-11253106.11” displayed bottom middle'); + * describe('“+11253106.11” top middle and “-11253106.11” displayed bottom middle'); * } * * @@ -464,8 +462,7 @@ function addNfs(num) { * text(splitString[0], 5, 30); * text(splitString[1], 5, 50); * text(splitString[2], 5, 70); - * describe('“pat” top left, “Xio” mid left, and - * “Alex” displayed bottom left'); + * describe('“Pat” top left, “Xio” mid left, and “Alex” displayed bottom left'); * * */