Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions utils/convert.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ const __dirname = path.dirname(__filename);

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

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

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

Expand Down
4 changes: 3 additions & 1 deletion utils/data-processor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ export function processData(rawData, strategy) {
continue;
}

const name = entry.name || (entry.properties || [])[0]?.name;
const name = entry.name ||
(entry.properties || [])[0]?.name ||
entry.tags?.find(t => t.title === 'property')?.name;

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