Skip to content

Commit c01c13b

Browse files
authored
Merge branch '2.0' into 2.0
2 parents effe99d + 16e4052 commit c01c13b

16 files changed

+44
-14
lines changed

src/content/contributor-docs/en/contributing_to_the_p5js_reference.mdx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -380,21 +380,35 @@ Class constructors are defined with the `@class` tag and the `@constructor` tag.
380380

381381
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.
382382

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:
384391

385392
```
386-
npm run docs
393+
npm install
387394
```
388395

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 `#`:
392397

393398
```
394-
npm run docs:dev
399+
npm run custom:dev https://github.com/yourUsername/p5.js.git#yourBranch
395400
```
396401

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+
![Terminal output showing successful npm run custom:dev execution](src/content/contributor-docs/images/custom-dev-terminal-output.png)
406+
407+
* When you're done, you can run this command to reset your changes:
408+
409+
```
410+
npm run custom:cleanup
411+
```
398412

399413
* 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.
400414

36.7 KB
Loading

src/content/tutorials/en/get-started.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,18 @@ Using the [p5.js Web Editor](https://editor.p5js.org/):
5353

5454
- Log in to the [p5.js Web Editor](https://editor.p5js.org/).
5555
- Name your project “Interactive Landscape” by clicking the *pencil icon* and typing “Interactive Landscape” into the text box that appears.
56+
57+
![A user on the p5.js Web Editor names a new project “Interactive Landscape”.](../images/introduction/p5_editor_interactive_landscape_1.png)
58+
5659
- Click on *File* and select *Save*.
60+
61+
![A user on the p5.js Web Editor saves their new project "Interactive Landscape".](../images/introduction/p5_editor_interactive_landscape_2.png)
62+
5763
- Confirm your project is saved by navigating to your gallery of saved sketches:
5864
- Click on *File* and select *Open*.
5965
- Your most recent sketches will appear at the top of the list of projects saved on your account.
6066

61-
![A user on the p5.js Web Editor names a new project Interactive Landscape”, saves it, finds it in their gallery of saved sketches, and clicks the project's name to open it.](../images/introduction/rename-sketch.gif)
67+
![A user on the p5.js Web Editor finds their project "Interactive Landscape" in their gallery of saved sketches.](../images/introduction/p5_editor_interactive_landscape_3.png)
6268

6369
#### Default Code
6470

src/content/tutorials/en/setting-up-your-environment.mdx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A quick tutorial for setting up the p5.js Web Editor and VS Code to
44
category: introduction
55
categoryIndex: 0
66
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.
88
relatedContent:
99
references:
1010
- 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
6161
- Open a desktop browser on your computer and go to [https://editor.p5js.org/](https://editor.p5js.org/).
6262
- Click the [“Sign up”](https://editor.p5js.org/signup) link on the top-right of the web page.
6363

64-
![An arrow pointing to the “Sign Up” link in the top right corner of the p5.js Web Editor.](../images/introduction/web-editor-signup.png)
64+
![An arrow pointing to the “Sign Up” link in the top right corner of the p5.js Editor.](../images/introduction/p5_editor_sign_up.png)
6565

6666

6767
### 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
7373
- Create and confirm a password. 
7474
- Click the “Sign Up” button.
7575

76-
![A user clicks the “Sign Up” button in the p5.js Web Editor, enters a new username, email address, and password.](../images/introduction/editor-signup.gif)
76+
77+
![An arrow pointing to the highlighted fields on the Sign Up page, as described above.](../images/introduction/p5_editor_sign_up_page.png)
78+
7779

7880
- Using a Google account
7981
- 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
98100

99101
The following diagram labels and describes each element of the editor’s interface:
100102

101-
![A labeled diagram of the p5.js Web Editor’s user interface.](../images/introduction/web-editor-diagram.png)
103+
![A labeled diagram of the p5.js Web Editor’s user interface.](../images/introduction/p5_editor_interface_breakdown.png)
104+
105+
{/* ![Play and Stop buttons.](../images/introduction/p5_editor_play_start.png)
106+
![Settings button with a gear icon in the center.](../images/introduction/p5_editor_settings.png) */}
102107

103108

104109
### Step 4: Name, save, and run your first sketch
105110

106111
- Name your projects by clicking on the pencil icon above the text editor and typing in a name for your project.
112+
113+
![An arrow points to a pencil icon to rename a sketch.](../images/introduction/p5_editor_naming_a_sketch.png)
114+
107115
- Save projects by clicking on *File* in the top toolbar, and selecting *Save*
108116
- Make sure you are logged in to your account or you will not be able to save the sketch.
109117
- 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.
110118

111-
![A user on the p5.js Web Editor names a new project “My First Sketch” and saves it. A notification box then appears for a moment with the text “Sketch saved.”](../images/introduction/renameSave.gif)
119+
![A user on the p5.js Web Editor names a new project and saves it.”](../images/introduction/p5_editor_saving_a_sketch.png)
120+
121+
![An arrow pointing to a notification box with the text “Sketch saved.”](../images/introduction/p5_editor_saved_sketch_notification.png)
112122

113123
To view the output of your code, click the *Play* button in the top left corner: 
114124

115-
![A blank canvas appears in the preview window of the p5.js Web Editor when a user clicks on the “Play” button in the top right corner.](../images/introduction/play.gif)
125+
![A blank canvas appears in the preview window of the p5.js Web Editor when a user clicks on the “Play” button in the top right corner.](../images/introduction/p5_editor_running_a_sketch.png)
116126

117127
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)
118128

138 KB
Loading
121 KB
Loading
143 KB
Loading
183 KB
Loading
144 KB
Loading
3.13 KB
Loading

0 commit comments

Comments
 (0)