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

Generate .pdez files for each code example #445

Open
SableRaf opened this issue Feb 20, 2023 · 6 comments
Open

Generate .pdez files for each code example #445

SableRaf opened this issue Feb 20, 2023 · 6 comments

Comments

@SableRaf
Copy link
Collaborator

Context

As part of the effort to improve the Processing website and editor, a new feature has been introduced to allow users to open sketches and libraries directly in the Processing editor by clicking on a link. This will allow us to add a link to each example, opening the corresponding sketch directly in the Processing editor.

Problem statement

When browsing the examples page we want users to be able to run the examples in the Processing Development Environment (PDE). Currently, it can be time-consuming and confusing for users to manually copy and paste each tab of an example into the PDE and ensure that all required assets (e.g., images, fonts) are present.

The planned "Open in Processing Editor" feature aims to address this issue. However, it requires that each example have a .pdez file, which is not currently generated when running the script that copies examples over from the processing-examples repository.

Proposed solution

To address this issue, we can modify the existing updateExamples script that copies Processing code for each example from the processing-examples repository to the Processing website. Specifically, we can update the script to automatically generate .pdez files for each example and add them to the corresponding example folder in addition to the existing .pde files and any other files that are already being copied over.

Benefits

This change would greatly benefit users who want to quickly run examples from the website without having to manually copy and paste each tab into the PDE. By automating the process of generating .pdez files for each example, we can improve the user experience and make it easier for people to get started with Processing.

References

The process of updating examples on the website is described in details here:
https://github.com/processing/processing-website/blob/main/docs/examples.md

@0xriyadh
Copy link

0xriyadh commented Apr 2, 2023

Hello @SableRaf, whenever I am trying to open this file somesketch.pdez using the link pde://processing.org/somesketch.pdez mentioned in the 4.2 release it just opens up the processing software, not the actual file it was supposed to open.

I am using an Apple Macbook M1 device

@SableRaf
Copy link
Collaborator Author

SableRaf commented Apr 3, 2023

Hi @mahadihassanriyadh. pde://processing.org/somesketch.pdez is not a valid link to an existing file, but rather a placeholder link. In order to open a .pdez file in Processing, you'll need to create one yourself. To do this, you can simply zip up a Processing sketch folder and rename the extension to .pdez. Once you have created the .pdez file, you can host it on a web server or open it locally by specifying the file path. I hope that helps! Let me know if you have any further questions.

@EshaanAgg
Copy link

EshaanAgg commented Apr 7, 2023

@SableRaf How can we create a .pdez file from one (or multiple) .pde files. Like for the Flocking we have 3 .pde files present in the examples repository. Will zipping them up and renaming the extension to .pdez would create a valid file? Can you point me to some documentation about this format so that I can explore it myself?

@EshaanAgg
Copy link

@SableRaf I have created a basic script which would basically zip the content of each example folder in processing-examples to create a .pdez file in the processing-website repository. Here is the link to the same. Can you PTAL and comment on the same?

@SableRaf
Copy link
Collaborator Author

Hi @EshaanAgg and sorry for the late reply. This sounds exciting! I'll have a look as soon as possible but it may still take a little while. Thanks for your patience.

@umangutkarsh
Copy link

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

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

Successfully merging a pull request may close this issue.

4 participants