Generates Tern def file for p5.js from source by using yuidoc. A fork of @angelozerr's tern.yuidoc.
- Clone the repository with
git clone git@github.com:kaganjd/tern.yuidoc.git
- Install dependencies with
npm install
- Put the p5.js data.json file in the project root
- Run grunt tasks with
grunt
- One of the grunt tasks starts a local server. When the tasks are complete, manually kill the server with
ctrl + c
grunt replace
matches and removes<p>
and</p>
tags in the data.json, then saves the updated file in temp/grunt file_append
prepends "var yuiDoc =" to temp/data.jsongrunt rename
moves temp/data.json to generator/ and renames it yui.data.json.js so it can be read by the generator scriptgrunt connect
starts a server so we can generate the Tern def file in the browser. A script in the HTML file automatically downloads the generated file.
Running just grunt
automatically runs all four tasks, but you can choose to run one at a time.
The basic structure of the project is given in the following way:
- data.json in the project root is the starting file; you can get it at https://p5js.org/reference/data.json
generator/
generates YUI tern plugin from yuidoc data.json by using HTML pageslib/
scripts to transform yuidoc data.json to Tern def