processing-website icon indicating copy to clipboard operation
processing-website copied to clipboard

Add "Open in Processing" link to code examples

Open SableRaf opened this issue 2 years ago • 13 comments

Problem statement

Currently, to open a Processing example in the Processing Development Environment (PDE), users have to manually copy and paste each tab from the Processing website to the PDE editor. Additionally, they may struggle with missing files if any images, fonts, or other assets are required by the sketch.

Context

With the latest version of Processing (4.2), it is now possible to link to .pdex and .pdez files to run sketches and install libraries immediately in the PDE. However, the examples and reference examples on the Processing website do not yet have this feature.

In a separate issue, we have proposed updating the build process for the Processing website to automatically generate .pdez files for each example. This is the first step towards adding an "Open in Processing Editor" link to all examples on the website.

Proposed solution

To enable users to open Processing examples directly in the PDE editor, we propose adding an "Open in Processing" button next to each example on the Processing website. Clicking the button will automatically launch the example in the PDE.

The button link should use the newly introduced pde:// protocol and be in the format: pde://processing.org/examples/.../myexample.pdez.

We could include a tooltip to indicate that this button will launch the Processing Editor.

Benefits

The "Open in Processing" button will make it easier for users to get started with Processing by removing the manual copying and pasting process. This will save time and reduce the risk of errors when setting up and running examples.

References

  • Related issue: https://github.com/processing/processing-website/issues/445

SableRaf avatar Feb 20 '23 14:02 SableRaf

hey, I want to contribute. I would love to try my hands please guide me on how to get started!!

nikhilhvr avatar Feb 25 '23 12:02 nikhilhvr

Hello @nikhilhvr and thank you so much for offering to contribute! We appreciate your interest in helping out. The first step in getting started would be to ensure that you can build the website locally. You can find instructions on how to do this here.

If you have any specific questions about the issue or the proposed solution, please don't hesitate to ask. I'm here to help.

SableRaf avatar Feb 27 '23 13:02 SableRaf

hello, @SableRaf I am done with the setup website locally. I tried to find the optimal solution to this issue but I didn't see much. Please guide me on how to get started.

nikhilhvr avatar Mar 03 '23 09:03 nikhilhvr

@nikhilhvr: Great! The idea is to add an Open in Processing button next to the Copy button for each example. Please let me know what specific questions you have an I'll try to assist you.

image

SableRaf avatar Mar 13 '23 18:03 SableRaf

is this issue is solved?

kaustubh-Joshi1020 avatar Mar 27 '23 14:03 kaustubh-Joshi1020

Hi @kaustubh-Joshi1020! I can confirm that this issue is still open. If you have any further questions, please feel free to let us know.

SableRaf avatar Mar 28 '23 13:03 SableRaf

ok thanks👍

kaustubh-Joshi1020 avatar Mar 28 '23 14:03 kaustubh-Joshi1020

@SableRaf I would like to work on this issue. Can you please assign it to me if any other contributors aren't working on it?

EshaanAgg avatar Apr 07 '23 20:04 EshaanAgg

Hi @EshaanAgg and sorry for the late reply. I have assigned the issue to you. Thanks for looking into this!

SableRaf avatar Apr 28 '23 07:04 SableRaf

Thanks @SableRaf. I have started first creating the .pdez files for the examples as a part of #445.

EshaanAgg avatar Apr 28 '23 08:04 EshaanAgg

Quick update to share my reference technical implementation for the Open in Processing button:

https://sableraf.github.io/testURIscheme/

Notice the tooltip that serves as a fallback in case Processing is not installed.

The UX/UI could certainly be improved (cc @runemadsen). For example, we could also consider having a separate button for downloading the sketch. Consider this a first draft.

Note: support for pde:// on Linux is still pending but this Pull Request should solve the issue: https://github.com/processing/processing4/pull/696

SableRaf avatar Jun 27 '23 11:06 SableRaf

@SableRaf I see that the issue is still open. Would like to work on it. I request you to assign me this issue.

AaryaZ avatar Aug 23 '23 15:08 AaryaZ

Hi @SableRaf , I'd like to contribute. If this issue is still open please consider the PR I've made and provide feedback if required.

umangutkarsh avatar Oct 04 '23 08:10 umangutkarsh