Skip to content

Commit a0fe46f

Browse files
authored
Merge pull request #8257 from processing/fix-site
Add fallback for property tags that don't fully parse
2 parents 3dd4ffd + 57a21ec commit a0fe46f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

utils/convert.mjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ const __dirname = path.dirname(__filename);
99

1010
const data = JSON.parse(fs.readFileSync(path.join(__dirname, '../docs/data.json')));
1111

12-
// Strategy for HTML documentation output (maintains exact convert.mjs behavior)
12+
// Generate documentation used in the p5.js reference. This data will get read in
13+
// the p5.js-website repo: https://github.com/processing/p5.js-website/
1314
const htmlStrategy = {
14-
shouldSkipEntry: () => false, // Don't skip anything (including Foundation)
15+
shouldSkipEntry: (entry) =>
16+
// Skip static methods on p5.Vector for now because the names clash with
17+
// the non static versions
18+
entry.scope === 'static' &&
19+
entry.memberof === 'Vector' &&
20+
['add', 'sub', 'mult', 'div', 'copy', 'rem', 'rotate', 'dot', 'cross', 'dist', 'lerp', 'slerp',
21+
'mag', 'magSq', 'normalize', 'limit', 'setMag', 'heading', 'angleBetween', 'reflect',
22+
'array', 'equals'].includes(entry.name),
1523

1624
processDescription: (desc) => descriptionString(desc),
1725

utils/data-processor.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ export function processData(rawData, strategy) {
121121
continue;
122122
}
123123

124-
const name = entry.name || (entry.properties || [])[0]?.name;
124+
const name = entry.name ||
125+
(entry.properties || [])[0]?.name ||
126+
entry.tags?.find(t => t.title === 'property')?.name;
125127

126128
// Skip duplicates based on name + class combination
127129
const key = `${name}:${forEntry || 'p5'}`;

0 commit comments

Comments
 (0)