Skip to content

Commit

Permalink
Merge pull request #7253 from visheshrwl/main
Browse files Browse the repository at this point in the history
Fixed broken links for p5js references
  • Loading branch information
Qianqianye authored Sep 8, 2024
2 parents 51d84e6 + 05404e8 commit a4b4260
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -6309,6 +6309,15 @@
"contributions": [
"example"
]
},
{
"login": "visheshrwl",
"name": "Vishesh Rawal",
"avatar_url": "https://avatars.githubusercontent.com/u/92795514?v=4",
"profile": "https://github.com/visheshrwl",
"contributions": [
"bug", "doc", "code"
]
}
],
"repoType": "github",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ We recognize all types of contributions. This project follows the [all-contribut
<td align="center" valign="top" width="16.66%"><a href="https://github.com/benpalevsky"><img src="https://avatars.githubusercontent.com/u/25121735?v=4?s=120" width="120px;" alt="benpalevsky"/><br /><sub><b>benpalevsky</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=benpalevsky" title="Documentation">📖</a></td>
<td align="center" valign="top" width="16.66%"><a href="http://jeanetteandre.ws"><img src="https://avatars.githubusercontent.com/u/12685889?v=4?s=120" width="120px;" alt="jeanette"/><br /><sub><b>jeanette</b></sub></a><br /><a href="https://github.com/processing/p5.js/commits?author=jeanetteandrews" title="Code">💻</a></td>
<td align="center" valign="top" width="16.66%"><a href="https://github.com/williamthazard"><img src="https://avatars.githubusercontent.com/u/105560469?v=4?s=120" width="120px;" alt="William Hazard"/><br /><sub><b>William Hazard</b></sub></a><br /><a href="#example-williamthazard" title="Examples">💡</a></td>
<td align="center" valign="top" width="16.66%"><a href="https://github.com/visheshrwl"><img src="https://avatars.githubusercontent.com/u/92795514?v=4" width="120px;" alt="Vishesh Rawal"/><br /><sub><b>Vishesh Rawal</b></sub></a><br /><a href="https://visheshrwl.vercel.app" title="Vishesh Rawal">💡</a></td>
</tr>
</tbody>
</table>
Expand Down
6 changes: 3 additions & 3 deletions src/core/friendly_errors/fes_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ if (typeof IS_MINIFIED !== 'undefined') {

//Whenever func having p5.[Class] is encountered, we need to have the error link as mentioned below else different link
funcName.startsWith('p5.') ?
msgWithReference = `${message} (http://p5js.org/reference/#/${referenceSection}.${funcName})` :
msgWithReference = `${message} (http://p5js.org/reference/#/${referenceSection}/${funcName})`;
msgWithReference = `${message} (http://p5js.org/reference/${referenceSection}.${funcName})` :
msgWithReference = `${message} (http://p5js.org/reference/${referenceSection}/${funcName})`;
}
return msgWithReference;
};
Expand Down Expand Up @@ -777,7 +777,7 @@ if (typeof IS_MINIFIED !== 'undefined') {

// if the flow gets this far, this is likely not a misspelling
// of a p5 property/function
let url = 'https://p5js.org/examples/data-variable-scope.html';
let url = 'https://p5js.org/tutorials/variables-and-change/';
p5._friendlyError(
translator('fes.globalErrors.reference.notDefined', {
url,
Expand Down
8 changes: 4 additions & 4 deletions src/core/friendly_errors/sketch_reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if (typeof IS_MINIFIED !== 'undefined') {
//if the element in variableArray is a p5.js constant then the below condidion
//will be true, hence a match is found
if (constants[variableArray[i]] !== undefined) {
let url = `https://p5js.org/reference/#/p5/${variableArray[i]}`;
let url = `https://p5js.org/reference/p5/${variableArray[i]}`;
//display the FES message if a match is found
p5._friendlyError(
translator('fes.sketchReaderErrors.reservedConst', {
Expand Down Expand Up @@ -100,7 +100,7 @@ if (typeof IS_MINIFIED !== 'undefined') {
undefined
) {
//if a p5.js function is used ie it is in the funcs array
let url = `https://p5js.org/reference/#/p5/${variableArray[i]}`;
let url = `https://p5js.org/reference/p5/${variableArray[i]}`;
p5._friendlyError(
translator('fes.sketchReaderErrors.reservedFunc', {
url,
Expand Down Expand Up @@ -296,7 +296,7 @@ if (typeof IS_MINIFIED !== 'undefined') {
//if the value is changed and if it is changed
//then report.
if (constants[tempArray[i]] !== element) {
let url = `https://p5js.org/reference/#/p5/${tempArray[i]}`;
let url = `https://p5js.org/reference/p5/${tempArray[i]}`;
p5._friendlyError(
translator('fes.sketchReaderErrors.reservedConst', {
url,
Expand Down Expand Up @@ -354,7 +354,7 @@ if (typeof IS_MINIFIED !== 'undefined') {
p5Constructors[keyArray[k]].prototype[functionArray[i]] !==
element
) {
let url = `https://p5js.org/reference/#/p5/${functionArray[i]}`;
let url = `https://p5js.org/reference/p5/${functionArray[i]}`;
p5._friendlyError(
translator('fes.sketchReaderErrors.reservedFunc', {
url,
Expand Down

0 comments on commit a4b4260

Please sign in to comment.