From dfd4af043cdc8246821a50255a319e8496b25043 Mon Sep 17 00:00:00 2001 From: rakesh Date: Fri, 2 Jan 2026 21:53:23 +0530 Subject: [PATCH 1/2] Fix #1030: route p5.sound reference links to correct GitHub repo (2.x) --- src/layouts/ReferenceItemLayout.astro | 94 ++++----------------------- 1 file changed, 14 insertions(+), 80 deletions(-) diff --git a/src/layouts/ReferenceItemLayout.astro b/src/layouts/ReferenceItemLayout.astro index 70d8b63ede..6f992b0a81 100644 --- a/src/layouts/ReferenceItemLayout.astro +++ b/src/layouts/ReferenceItemLayout.astro @@ -26,6 +26,12 @@ import _ from 'lodash'; const { entry, relatedEntries } = Astro.props; const currentLocale = getCurrentLocale(Astro.url.pathname); +/* 🔧 FIX #1030: choose correct GitHub repo for source links */ +const repo = + entry.data.module === "p5.sound" + ? "processing/p5.sound" + : "processing/p5.js"; + const examples = parseReferenceExamplesAndMetadata(entry.data.example) // Remove empty lines at the beginning and end of the examples ?.map((example) => ({ ...example, src: example.src.trim() })); @@ -183,12 +189,9 @@ const descriptionParts = description.split( entry.data.params.map((param: ReferenceParam) => (
- {param.rest ? `${param.name}1, ..., ${param.name}n` : param.name} -
+
{param.type && {param.type}: }
@@ -204,9 +207,7 @@ const descriptionParts = description.split( {param.rest ? `${param.name}1, ..., ${param.name}n` : param.name} -
+
{param.type && {param.type}: }
@@ -218,84 +219,17 @@ const descriptionParts = description.split( ) } - { - (entry.data.return) && ( - <> -
-

{t("Returns")}

-
-
- {entry.data.return.type && {entry.data.return.type}: } - -
-
-
- - ) - } - { - entry.data.properties && ( -
-

{t("Fields")}

- {Object.entries(entry.data.properties).map(([key, value]) => { - const propertyValue = value as { - description: string; - path: string; - }; - - return ( -
- - {key} - -
-
- ); - })} -
- ) - } - { - entry.data.methods && ( -
-

{t("Methods")}

- {Object.entries(entry.data.methods).map(([key, value]) => { - const methodValue = value as { - description: string; - path: string; - }; - - return ( -
- - {key} - -
-
- ); - })} -
- ) - } { entry.data.file && entry.data.line &&(
- Notice any errors or typos? Please let us know. Please feel free to edit + Notice any errors or typos? Please let us know. Please feel free to edit - {entry.data.file} - - and open a pull request! + href={`https://github.com/${repo}/blob/v${p5Version}/${entry.data.file}#L${entry.data.line}`} + > + {entry.data.file} + + and open a pull request!
) From 8b1cc9d7733fc5c4ce917c39f0fe6fee8b7720ba Mon Sep 17 00:00:00 2001 From: rakesh Date: Mon, 5 Jan 2026 17:59:45 +0530 Subject: [PATCH 2/2] Fix p5.sound reference source links to point to p5.sound.js repo --- src/layouts/ReferenceItemLayout.astro | 101 ++++++++++++++++++++++---- 1 file changed, 87 insertions(+), 14 deletions(-) diff --git a/src/layouts/ReferenceItemLayout.astro b/src/layouts/ReferenceItemLayout.astro index 6f992b0a81..66c8c6e2d3 100644 --- a/src/layouts/ReferenceItemLayout.astro +++ b/src/layouts/ReferenceItemLayout.astro @@ -25,12 +25,13 @@ import _ from 'lodash'; const { entry, relatedEntries } = Astro.props; const currentLocale = getCurrentLocale(Astro.url.pathname); - -/* 🔧 FIX #1030: choose correct GitHub repo for source links */ -const repo = - entry.data.module === "p5.sound" - ? "processing/p5.sound" - : "processing/p5.js"; +const isSound = entry.data.module === "p5.sound"; +const githubRepo = isSound + ? "processing/p5.sound.js" + : "processing/p5.js"; +const githubRef = isSound + ? "main" + : `v${p5Version}`; const examples = parseReferenceExamplesAndMetadata(entry.data.example) // Remove empty lines at the beginning and end of the examples @@ -189,9 +190,12 @@ const descriptionParts = description.split( entry.data.params.map((param: ReferenceParam) => (
+ {param.rest ? `${param.name}1, ..., ${param.name}n` : param.name} -
+
{param.type && {param.type}: }
@@ -207,7 +211,9 @@ const descriptionParts = description.split( {param.rest ? `${param.name}1, ..., ${param.name}n` : param.name} -
+
{param.type && {param.type}: }
@@ -219,17 +225,84 @@ const descriptionParts = description.split( ) } + { + (entry.data.return) && ( + <> +
+

{t("Returns")}

+
+
+ {entry.data.return.type && {entry.data.return.type}: } + +
+
+
+ + ) + } + { + entry.data.properties && ( +
+

{t("Fields")}

+ {Object.entries(entry.data.properties).map(([key, value]) => { + const propertyValue = value as { + description: string; + path: string; + }; + + return ( +
+ + {key} + +
+
+ ); + })} +
+ ) + } + { + entry.data.methods && ( +
+

{t("Methods")}

+ {Object.entries(entry.data.methods).map(([key, value]) => { + const methodValue = value as { + description: string; + path: string; + }; + + return ( +
+ + {key} + +
+
+ ); + })} +
+ ) + } { entry.data.file && entry.data.line &&(
- Notice any errors or typos? Please let us know. Please feel free to edit + Notice any errors or typos? Please let us know. Please feel free to edit - {entry.data.file} - - and open a pull request! + href={`https://github.com/${githubRepo}/blob/${githubRef}/${entry.data.file}#L${entry.data.line}`} + > + {entry.data.file} + + and open a pull request!
)