Skip to content

Commit 20ea6b2

Browse files
authored
Merge branch '2.0' into extra-slash
2 parents e7eb303 + 16e4052 commit 20ea6b2

41 files changed

Lines changed: 599 additions & 440 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

public/assets/anglurBulge.png

6.74 KB
Loading

public/assets/closeCurveSpline.png

5.36 KB
Loading

public/assets/excludeSpline.png

2.14 KB
Loading

public/assets/includeSpline.png

3.58 KB
Loading

public/assets/openCurveSpline.png

4.28 KB
Loading

public/assets/roundBulge.png

7.15 KB
Loading

public/reference/data.json

Lines changed: 41 additions & 40 deletions
Large diffs are not rendered by default.

src/api/OpenProcessing.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const newCurationId = "89576";
1919
*/
2020
export type OpenProcessingCurationResponse = Array<{
2121
/** Sketch ID used for constructing URLs */
22-
visualID: string;
22+
visualID: number;
2323
/** Title of sketch */
2424
title: string;
2525
/** Description of sketch */
@@ -85,7 +85,7 @@ export const getCurationSketches = memoize(async (
8585
*/
8686
export type OpenProcessingSketchResponse = {
8787
/** Sketch ID used for constructing URLs */
88-
visualID: string;
88+
visualID: number;
8989
/** Title of sketch */
9090
title: string;
9191
/** Description of sketch */
@@ -108,7 +108,7 @@ export type OpenProcessingSketchResponse = {
108108
* @returns
109109
*/
110110
export const getSketch = memoize(
111-
async (id: string): Promise<OpenProcessingSketchResponse> => {
111+
async (id: number): Promise<OpenProcessingSketchResponse> => {
112112
// check for memoized sketch in curation sketches
113113
const curationSketches = await getCurationSketches();
114114
const memoizedSketch = curationSketches.find((el) => el.visualID === id);
@@ -134,7 +134,7 @@ export const getSketch = memoize(
134134
* But only uses the width and height properties from this call
135135
* Width and height should instead be added to properties for `/api/sketch/:id` or `api/curation/:curationId/sketches` instead
136136
*/
137-
export const getSketchSize = memoize(async (id: string) => {
137+
export const getSketchSize = memoize(async (id: number) => {
138138
const sketch = await getSketch(id)
139139
if (sketch.mode !== 'p5js') {
140140
return { width: undefined, height: undefined };
@@ -164,16 +164,16 @@ export const getSketchSize = memoize(async (id: string) => {
164164
return { width: undefined, height: undefined };
165165
});
166166

167-
export const makeSketchLinkUrl = (id: string) =>
167+
export const makeSketchLinkUrl = (id: number) =>
168168
`https://openprocessing.org/sketch/${id}`;
169169

170-
export const makeSketchEmbedUrl = (id: string) =>
170+
export const makeSketchEmbedUrl = (id: number) =>
171171
`https://openprocessing.org/sketch/${id}/embed/?plusEmbedFullscreen=true&plusEmbedInstructions=false`;
172172

173-
export const makeThumbnailUrl = (id: string) =>
173+
export const makeThumbnailUrl = (id: number) =>
174174
`https://openprocessing-usercontent.s3.amazonaws.com/thumbnails/visualThumbnail${id}@2x.jpg`;
175175

176-
export const getSketchThumbnailSource = async (id: string) => {
176+
export const getSketchThumbnailSource = async (id: number) => {
177177
const manualThumbs = import.meta.glob<ImageMetadata>('./images/*', { import: 'default' })
178178
const key = `./images/${id}.png`;
179179
if (manualThumbs[key]) {

src/components/Footer/index.astro

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,35 @@ const bannerEntry = await getEntry("banner", currentLocale);
5050
<div class="lg:col-start-2 mt-xl lg:mt-0">
5151
<div class="mb-5" id="socials-footer-category">{t("Socials")}</div>
5252
<ul aria-labelledby="socials-footer-category">
53-
<li><a href="https://github.com/processing/p5.js">GitHub</a></li>
54-
<li><a href="https://www.instagram.com/p5xjs/">Instagram</a></li>
55-
<li><a href="https://twitter.com/p5xjs">X</a></li>
56-
<li><a href="https://www.youtube.com/@ProcessingFoundation">YouTube</a></li>
57-
<li><a href="https://discord.gg/SHQ8dH25r9">Discord</a></li>
5853
<li>
59-
<a href="https://discourse.processing.org/c/p5js">{t("Forum")}</a>
54+
<a href="https://github.com/processing/p5.js" target="_blank" rel="noopener noreferrer" title="Opens in new tab">
55+
GitHub ↗
56+
</a>
57+
</li>
58+
<li>
59+
<a href="https://www.instagram.com/p5xjs/" target="_blank" rel="noopener noreferrer" title="Opens in new tab">
60+
Instagram ↗
61+
</a>
62+
</li>
63+
<li>
64+
<a href="https://twitter.com/p5xjs" target="_blank" rel="noopener noreferrer" title="Opens in new tab">
65+
X ↗
66+
</a>
67+
</li>
68+
<li>
69+
<a href="https://www.youtube.com/@ProcessingFoundation" target="_blank" rel="noopener noreferrer" title="Opens in new tab">
70+
YouTube ↗
71+
</a>
72+
</li>
73+
<li>
74+
<a href="https://discord.gg/SHQ8dH25r9" target="_blank" rel="noopener noreferrer" title="Opens in new tab">
75+
Discord ↗
76+
</a>
77+
</li>
78+
<li>
79+
<a href="https://discourse.processing.org/c/p5js" target="_blank" rel="noopener noreferrer" title="Opens in new tab">
80+
{t("Forum")}
81+
</a>
6082
</li>
6183
</ul>
6284
</div>
@@ -65,3 +87,4 @@ const bannerEntry = await getEntry("banner", currentLocale);
6587
{bannerEntry && !bannerEntry.data.hidden && (<Banner entry={bannerEntry} />)}
6688

6789
<style></style>
90+

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

0 commit comments

Comments
 (0)