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.
0 commit comments