P5.js-web-editor: Add script to generate syntax highlighting files

Created on 30 Apr 2019  路  20Comments  路  Source: processing/p5.js-web-editor

Nature of issue?

  • Existing feature enhancement

Feature enhancement details:

978 was recently fixed, which fixed certain p5.js keywords not being highlighted. I would like to automate this process by pulling from https://p5js.org/reference/data.json.

This issue involves writing a script that generates the p5-javascript.js file from https://p5js.org/reference/data.json.

good first issue help wanted medium task

All 20 comments

Cool ! I will have a look at this later .
In the meantime if anyone wants to pick this up , go ahead .

Hi, I want to work on this issue.
Is it open?

hi,if it is still an issue,Please allow me to fix.

Go for it!

Hi,Could you please help me how to approch?

@catarak has provided the link above , I think you can look at
https://github.com/processing/p5.js-web-editor/blob/master/client/utils/p5-javascript.js

@singhvisha go ahead and work on this! you'll need to parse the data.json file, pull out the p5.js keywords, and then dump them into the p5-javascript.js file by making a template file to insert them into. let me know if you need more help!

Hi, is anyone already working on this issue? I'd like to give it a shot, if not.

@SGeetansh go ahead and work on this!

Hey! I s this issue still open? Can I work upon this issue? @catarak

@catarak Kindly assign me an issue. Thanks!

@simranaggarwal1999 I started working on somethng else meanwhile. You go ahead if you want to. Best of luck!

@catarak can you guide a little please on how to start working on this issue

@catarak i would like to work on this issue, can you please assign it to me?

@catarak in which file should i add the request for json file

I would like to work on this issue, if it's still not done.

Go ahead! No one else is working on it at the moment.

@catarak I have written a simple script, here is the gist. I have tested that it captures all the function names and keywords already existing in the code base (p5-javascript.js) and also many new ones defined in data.json file. It would be great if you can have a look. I was also wondering what would be the right way to incorporate this in the code base, I would be thankful if you could share your views on that too..

Amazing work @thegitone23, thank you! I think this is a great start. What I would recommend you do next is:

  1. Rather than using a local data.json, have it pull from the p5.js website url. request is already a dependency in the web editor so you could use that library.
  2. Create a template version of p5-javascript.js that will allow you to inject those keywords.
  3. Write code that reads p5-javascript.template.js, inserts the keywords into the right place, and then writes the resulting string to the file p5-javascript.js.

I would put the file you're working on in server/scripts/ in the web editor repository.

Thank You @catarak .. I will start working on the next part accordingly, and will soon report my progress ..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willingc picture willingc  路  5Comments

meiamsome picture meiamsome  路  4Comments

andytilia picture andytilia  路  4Comments

slowizzm picture slowizzm  路  4Comments

zeyaoli picture zeyaoli  路  4Comments