I feel like some docs could benefit from visual diagrams, for example using toos like Mermaid.js, etc.
For example explaining BufferGeometryUtils.toCreasedNormals could have a diagram that shows what the angle is relative to two faces (you might think it accepts the angle between the faces, but that’s not true, however the wording sounds like it). It would be a simple 2D diagram: three dots with lines connecting them, and an angle marker.
At some point the API documentation might be generated from JSDoc (see RFC: Adopting JSDoc in three.js · GitHub). It would not be possible to retain the diagrams if we decide to go that route.
TS/JSDoc comments are markdown content which includes HTML. If we include a Custom Element (aka Web Component) inside a JSDoc comment, it can automatically come to life on a web page (while being invisible inside markdown-rendered tooltips in VS Code).
For example, here in the JSDoc comment of my MixedPlane class I have a small piece of HTML:
Here’s the implementation of <live-code>:
The Lume docs site has a <script> tag that imports the live-code module so that the element will be defined.
The custom elements don’t require any build tooling, useful for this sort of thing. Lume’s doc site is a static website, no build step is needed except for one that transfers the JSDoc comments into markdown files (my own JSDoc parser in this case). The demo that <live-code> links to is simply a static HTML page: