You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/contributor-docs/en/contributing_to_the_p5js_reference.mdx
+21-7Lines changed: 21 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -380,21 +380,35 @@ Class constructors are defined with the `@class` tag and the `@constructor` tag.
380
380
381
381
The p5.js repository is set up so that you can generate and preview the reference without needing to build and run the p5.js website as well.
382
382
383
-
* The main command to generate the reference from the reference comments in the source code is to run the following command.
383
+
To do so, make sure you have committed and pushed your changes to a branch of your fork of p5.js.
384
+
385
+
**Important:** Make sure you're working with compatible branches:
386
+
387
+
- Use the `2.0` branch of p5.js-website with the `dev-2.0` branch of p5.js
388
+
- Use the `main` branch of p5.js-website with the `main` branch of p5.js
389
+
390
+
* First, ensure you have the necessary dependencies installed in the p5.js-website repository:
384
391
385
392
```
386
-
npm run docs
393
+
npm install
387
394
```
388
395
389
-
This will generate the necessary preview files and the main `docs/reference/data.json` file, which is the same file (after minification) that will be used to render the reference page on the website.
390
-
391
-
* For continuous work on the reference, you can run the following command.
396
+
* Then, in the p5.js-website repo, run the following command, using the URL of your fork of p5 before the `#`, and the name of your branch after the `#`:
392
397
393
398
```
394
-
npm run docs:dev
399
+
npm run custom:dev https://github.com/yourUsername/p5.js.git#yourBranch
395
400
```
396
401
397
-
This will launch a live preview of the rendered reference that will update each time you make changes (you will need to refresh the page after making changes to see them appear). This is useful, especially for previewing example code running in the browser.
402
+
This will build the reference from your branch and start a development preview of the website. A URL will be logged in the console that you can go to in your browser to test out your changes.
403
+
404
+
If everything is working correctly, your terminal output should look similar to this:
405
+

406
+
407
+
* When you're done, you can run this command to reset your changes:
408
+
409
+
```
410
+
npm run custom:cleanup
411
+
```
398
412
399
413
* The main template files are stored in the `docs/` folder and, in most cases, you should not make changes directly to files in this folder, except to add new asset files in the `docs/yuidoc-p5-theme/assets` folder.
Copy file name to clipboardExpand all lines: src/content/tutorials/en/get-started.mdx
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,12 +53,18 @@ Using the [p5.js Web Editor](https://editor.p5js.org/):
53
53
54
54
- Log in to the [p5.js Web Editor](https://editor.p5js.org/).
55
55
- Name your project “Interactive Landscape” by clicking the *pencil icon* and typing “Interactive Landscape” into the text box that appears.
56
+
57
+

58
+
56
59
- Click on *File* and select *Save*.
60
+
61
+

62
+
57
63
- Confirm your project is saved by navigating to your gallery of saved sketches:
58
64
- Click on *File* and select *Open*.
59
65
- Your most recent sketches will appear at the top of the list of projects saved on your account.
60
66
61
-

67
+

Copy file name to clipboardExpand all lines: src/content/tutorials/en/setting-up-your-environment.mdx
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: A quick tutorial for setting up the p5.js Web Editor and VS Code to
4
4
category: introduction
5
5
categoryIndex: 0
6
6
featuredImage: ../images/featured/SetupA.jpg
7
-
featuredImageAlt: An interactive sketch in the p5.js Web Editor draws circles on the canvas as the mouse pointer moves.
7
+
featuredImageAlt: An interactive sketch in the p5.js Editor draws circles on the canvas as the mouse pointer moves.
8
8
relatedContent:
9
9
references:
10
10
- en/p5/setup
@@ -61,7 +61,7 @@ If you are new to p5.js, start with the [p5.js Web Editor](https://editor.p5js.o
61
61
- Open a desktop browser on your computer and go to [https://editor.p5js.org/](https://editor.p5js.org/).
62
62
- Click the [“Sign up”](https://editor.p5js.org/signup) link on the top-right of the web page.
63
63
64
-

64
+

65
65
66
66
67
67
### Step 2: Create an account with [p5.js Web Editor](https://editor.p5js.org/)
@@ -73,7 +73,9 @@ If you are new to p5.js, start with the [p5.js Web Editor](https://editor.p5js.o
73
73
- Create and confirm a password.
74
74
- Click the “Sign Up” button.
75
75
76
-

76
+
77
+

78
+
77
79
78
80
- Using a Google account
79
81
- Click on the button on the bottom of the page that says “Login with Google.”
@@ -98,21 +100,29 @@ The [p5.js Web Editor](https://editor.p5js.org/) is an online environment where
98
100
99
101
The following diagram labels and describes each element of the editor’s interface:
100
102
101
-

103
+

104
+
105
+
{/* 
106
+
 */}
102
107
103
108
104
109
### Step 4: Name, save, and run your first sketch
105
110
106
111
- Name your projects by clicking on the pencil icon above the text editor and typing in a name for your project.
112
+
113
+

114
+
107
115
- Save projects by clicking on *File* in the top toolbar, and selecting *Save*.
108
116
- Make sure you are logged in to your account or you will not be able to save the sketch.
109
117
- Saving projects frequently helps to ensure that code isn’t lost if something happens to your computer, browser, or internet connection while you are coding.
110
118
111
-

119
+

120
+
121
+

112
122
113
123
To view the output of your code, click the *Play* button in the top left corner:
114
124
115
-

125
+

116
126
117
127
A *p5.js sketch* is a text file with code written in the *JavaScript* programming language. *JavaScript* is a programming language used to make web pages interactive. p5.js is a library written in *JavaScript* – which is why it ends in “*.js*” for *JavaScript*. With p5.js, you can create programs that are colorful and animated, with features that users can interact with! To learn more about some of the things you can do with p5.js, watch the [p5.js Welcome Video!](https://hello.p5js.org/) To learn more about JavaScript, you can visit [this resource.](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
0 commit comments