tabreturn / pyde.org

A collection of Processing Python Mode / Processing.py resources
8 stars 0 forks source link
processing-py processing-python python-mode

pyde.org

A collection of examples, cheatsheets, and other Processing Python Mode / Processing.py resources

This repository hosts the source files for PYDE.ORG, which includes Python Mode ports of the Java examples on the official Processing wesbite. Processing includes these examples in Python Mode (accessible in the IDE from the File > Examples... menu).

Instructions

This is a hand-rolled static site generator built using Jinja2 for templating and pyp5js to transpile processing.py files to p5.js. It uses a modified Pygments lexer for syntax highlighting.

Install the relevant Python 3 libraries (see requirements.txt). Run python3 generate.py to generate the website (that's output to the _site directory).

The generate.py script transpile sketches you place the examples directory. It requires them organized as follows: category > sub-category > sketch > sketch.pyde. For example: Basics > Structure > Coordinates > Coordinates.pyde

Note that pyp5js has it's limitations, related to differences between Processing.py and p5.js.

Using the Standard Python Mode Examples

You can retrieve the Python Mode / Processing.py example files from https://github.com/jdf/processing.py/tree/master/mode/examples, and place those in the examples directory.

There are some sketches that are problematic that you'll need to delete. Many fail because of the way they're organized (directory structure) which isn't difficult to fix manually.

You'll need to delete or reorganise the following:

Just because the transpiling process runs, and the website builds, doesn't mean all of the sketches will work. This is still, very much, a work in progress. Some sketches will require manual intervention / some rewriting. I plan to work through the checklist whenever I get the time. I've used regex/replace() as workarounds for what pyp5js can't handle right now, which might result in odd behavior (for example, if the generate script detects keywords in your sketch comments). You can check the contents of the examples/_temp directory to examine what might cause some sketch to fail.

Todo