Skip to content

Instantly share code, notes, and snippets.

View Ajaya1000's full-sized avatar
🐵
Learning

Ajaya Mati Ajaya1000

🐵
Learning
View GitHub Profile
@kaganjd
kaganjd / p5-tern.md
Last active February 19, 2022 13:34

Generating a Tern.js defs file for p5.js

Goal

p5 source code --> YUIDoc JSON --> Tern defs JSON

Process

Because p5.js uses YUIDoc to generate documentation, I'm using @angelozerr's tern.yuidoc plugin to generate a Tern.js defs file for p5.js. Ultimately, this will be used to implement code hints and autocomplete in the p5.js web editor.

  1. Get the p5.js API JSON file from the p5 website, here. Learn more about the p5.js API JSON file here.
  2. Then, get the Tern defs generator. Clone @angelozerr's repo with $ git clone https://github.com/angelozerr/tern.yuidoc