Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: API to create a sketch and send code for it #663

Open
terabyte128 opened this issue Jul 8, 2018 · 4 comments
Open

Feature request: API to create a sketch and send code for it #663

terabyte128 opened this issue Jul 8, 2018 · 4 comments

Comments

@terabyte128
Copy link

terabyte128 commented Jul 8, 2018

New feature details:

I am working on a project that helps transpile Processing Java code to p5.js. It would be awesome if there were a way to allow a user to click a button that redirects them to this site with their code already pasted into the editor. Perhaps making a request to a URL with the body as their project code could create a new project and redirect them to it, or something like that.

(If I have time, I can work on this feature myself -- right now I'm still finishing up the other project, so I thought I'd toss it out here to gauge interest!)

@catarak
Copy link
Member

catarak commented Jul 12, 2018

I think this is a great idea! In general I'm very supportive of ideas that integrate the web editor into other workflows.

This is somewhat related to #542, but definitely not the same.

@haschdl
Copy link

haschdl commented Nov 5, 2019

hello @terabyte128
I created a Python script for a similar task, however it doesn't take of everything - you still need to review the generated code. How is your tool implemented, and do you already have something to show?
What requires a lot of work in my case is when the PDE sketch used Classes (in tabs), or imports other Java packages.

Here is my gist with the script as it is now. https://gist.github.com/haschdl/3230f814566901e68e56a4d07cda8700

@terabyte128
Copy link
Author

terabyte128 commented Nov 5, 2019

Hi @haschdl, I took the somewhat more complex route of actually parsing the Java code into a syntax tree and making visitor passes. Right now it also doesn’t handle those more complex cases but may be more easily extensible. We’ve used it in a course I taught last winter and it worked well for beginner programmers. See: https://github.com/terabyte128/pde2js

@SushantBansal-tech
Copy link

SushantBansal-tech commented Mar 2, 2025

@catarak Hi , can I Still work on this Issue

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

No branches or pull requests

4 participants