Skip to content

Commit 57a21ec

Browse files
committed
Skip static vector methods when creating website docs
1 parent b63f3e6 commit 57a21ec

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
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

0 commit comments

Comments
 (0)