emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jarmo Hurri <jarmo.hurri@syk.fi>
To: emacs-orgmode@gnu.org
Subject: Re: Babel support for Processing-language
Date: Tue, 16 Sep 2014 13:19:49 +0300	[thread overview]
Message-ID: <87wq93euka.fsf@syk.fi> (raw)
In-Reply-To: 87lhpk4sdf.fsf@alphaville.bos.redhat.com

Nick Dokos <ndokos@gmail.com> writes:

> Jarmo Hurri <jarmo.hurri@syk.fi> 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-<lang>.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

  reply	other threads:[~2014-09-16 10:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 17:09 Babel support for Processing-language Jarmo Hurri
2014-09-15 19:05 ` Nick Dokos
2014-09-16 10:19   ` Jarmo Hurri [this message]
2015-02-02 11:07     ` Jarmo Hurri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wq93euka.fsf@syk.fi \
    --to=jarmo.hurri@syk.fi \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).