From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarmo Hurri Subject: Re: Babel support for Processing-language Date: Tue, 16 Sep 2014 13:19:49 +0300 Message-ID: <87wq93euka.fsf@syk.fi> References: <87egvcvmif.fsf@syk.fi> <87lhpk4sdf.fsf@alphaville.bos.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTprn-0008Nj-5M for emacs-orgmode@gnu.org; Tue, 16 Sep 2014 06:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTprg-00011g-TR for emacs-orgmode@gnu.org; Tue, 16 Sep 2014 06:20:11 -0400 Received: from plane.gmane.org ([80.91.229.3]:58674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTprg-0000n3-H0 for emacs-orgmode@gnu.org; Tue, 16 Sep 2014 06:20:04 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XTprc-0005DT-Ev for emacs-orgmode@gnu.org; Tue, 16 Sep 2014 12:20:00 +0200 Received: from host-137-163-18-130.edu.hel.fi ([137.163.18.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Sep 2014 12:20:00 +0200 Received: from jarmo.hurri by host-137-163-18-130.edu.hel.fi with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Sep 2014 12:20:00 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nick Dokos writes: > Jarmo Hurri writes: > >> ... >> However, I have _no idea_ what kind of work supporting output capture of >> both static mode (image) and active mode (animation) would >> require. Ideally, Babel support for Processing output would mean that in >> the case of >> 1. an animation >> - HTML export it would export the entire animation >> - PDF export it would export, e.g., the first frame from the >> animation >> 2. a static picture, the picture would be exported. > > Here's a possible starting point in your research: > > http://orgmode.org/worg/org-contrib/babel/languages.html#develop > > My next step would be to find an ob-.el that is as similar > as possible to what Processing does and what I'd want to achieve > and go from there. Yep, I am going to start doing this if no-one is working on it yet. I woke up in the middle of the night to realize how amazingly easily this can be done if I drop out the support for PDF export, that is, only leave the option to export as HTML. There is no need to even execute the code at export time to draw the image or the animation, because in HTML you can just wrap the original Processing code in a canvas element and the Processing.js code will draw it in the browser. http://en.wikipedia.org/wiki/Processing.js Let me repeat: by just exporting the code suitably embedded in the HTML document, the _browser_ will draw the image or the animation. I just tested it and it works perfectly. So I will implement this in Org/Babel so that - executing Processing code will result in the image / animation being shown in an external window via processing-java - exporting the results of Processing code is only sensible in HTML export, which will produce a web page with the code embedded as described above; the browser does the drawing. These operations will require the availability of processing-java and processing.js in the system where the code is executed/exported. Any objections? Jarmo