Skip to content

Add document about the v2 reference-generation process#8509

Open
nbogie wants to merge 7 commits intoprocessing:dev-2.0from
nbogie:nb-add-ref-gen-process-doc
Open

Add document about the v2 reference-generation process#8509
nbogie wants to merge 7 commits intoprocessing:dev-2.0from
nbogie:nb-add-ref-gen-process-doc

Conversation

@nbogie
Copy link
Copy Markdown
Contributor

@nbogie nbogie commented Feb 8, 2026

Fixes #8508

Changes:

Adds two new documents, makes no other changes.

  1. Add contributor_docs/reference_generation_process.md
  • section on main reference generation process
    • flow diagram
    • description of process steps and important files
  • minimal section on search index generation (diagram only). I don't want to tackle this topic further in this PR - happy to delete, if that's better.

I've tried to add a little colour to the flow diagram to help distinguish between actions which run in p5.js repo versus p5.js-website repo. However, we're at the mercy of the css that just inverts the mermaid diagram colours to get dark mode. Happy to resort to no extra colour if preferred.

  1. Add contributor_docs/type_generation_process.md
    • sparse description (lists main flow and processes, input and output files)
    • flow diagram
    • description of the patch process and example of patch syntax to use

nbogie added a commit to nbogie/p5.js that referenced this pull request Feb 8, 2026
nbogie added a commit to nbogie/p5.js that referenced this pull request Feb 12, 2026
@nbogie nbogie marked this pull request as ready for review April 27, 2026 17:30
@nbogie
Copy link
Copy Markdown
Contributor Author

nbogie commented Apr 27, 2026

If necessary/useful, I can raise a separate PR for the documentation of the type-generation process. (Until today i was writing them up in the same document.)

@nbogie nbogie force-pushed the nb-add-ref-gen-process-doc branch from 016ccef to 13d5fa9 Compare April 27, 2026 23:02
@p5-bot
Copy link
Copy Markdown

p5-bot Bot commented Apr 29, 2026

Copy link
Copy Markdown
Member

@ksen0 ksen0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## Need to know?

You don't need to know _any_ of this to successfully write and maintain the reference comments in the p5.js library! If you've questions about that, see [Contributing to the p5.js reference](./contributing_to_the_p5js_reference.md).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: I think this is a good first paragraph for the doc overall?


You don't need to know _any_ of this to successfully write and maintain the reference comments in the p5.js library! If you've questions about that, see [Contributing to the p5.js reference](./contributing_to_the_p5js_reference.md).

Warning: This describes how things work in April 2026 and is quite likely out of date!
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe state that this works as of april 2026, but link to the scripts being described. I know they're linked below but just for clarity of, "if this is out of date, please consult source of truth here"


You can run it locally and observe the outputs.

It is currently run by [a release process workflow](../.github/workflows/release-workflow-v2.yml) on Github Actions CI.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolute link probably needed because these docs will end up on the website where relative link will feel broken


\* The convert script has _also_ generated `/docs/parameterData.json` which is used by the friendly error system (FES) at runtime to validate function parameters. We won't discuss that further here.

#### Excerpt of /docs/reference.data.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo I think:

Suggested change
#### Excerpt of /docs/reference.data.json
#### Excerpt of /docs/reference/data.json

Copy link
Copy Markdown
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great @nbogie!

Copy link
Copy Markdown
Collaborator

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me @nbogie

* list key scripts up front
* bring "do you need to know this?" earlier
* absolute links to relevant source docs throughout

add end section on contributing to this document
@nbogie nbogie force-pushed the nb-add-ref-gen-process-doc branch from 1061b8e to 22679a8 Compare May 4, 2026 14:44
@nbogie
Copy link
Copy Markdown
Contributor Author

nbogie commented May 4, 2026

Thanks all!

  • Incorporated all those corrections/suggestions,
  • added an end section "contributing to this document", and
  • made a couple of minor readability tweaks

Copy link
Copy Markdown
Member

@ksen0 ksen0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nbogie ! I just spotted a couple of super minor things. I'll be making the RC in a couple of days and I'll merge this into that. I can apply the one type fix needed if you don't have time to touch it before then. Thanks again for all your work on fleshing out these docs!

The process described in this document does not apply to the types for the p5 v1 library. There are (often out-of-date) types at [definitely-typed](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/p5), packaged to npm as @types/p5. This document only discusses the types for p5 v2.


## Aside: "Why not just do X...
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: missing closing "


#### Summary:

Loads the generated `./docs/reference/data.json`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't run this locally but I'd imagine this should be a list but wouldn't show up as one? Feel free to ignore if I'm wrong

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, either I meant that or certainly it reads better as a list. I added a little to emphasise that this was the end of the focused flow, and to list briefly what will consume the MDX files downstream.


## Need to know?

You don't need to know _any_ of this to successfully write and maintain the reference comments in the p5.js library! If you've questions about that, see [Contributing to the p5.js reference](./contributing_to_the_p5js_reference.md).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

@nbogie
Copy link
Copy Markdown
Contributor Author

nbogie commented May 5, 2026

Incorporated typo + formatting corrections, thanks Kit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants