From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dirk-Jan C. Binnema" Subject: html export with htmlized code blocks Date: Tue, 19 May 2009 21:19:56 +0300 Message-ID: <20090519181956.GD6662@mindcrime> Reply-To: djcb@djcbsoftware.nl Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6Tv4-0002d0-0o for emacs-orgmode@gnu.org; Tue, 19 May 2009 14:20:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6Tuy-0002aZ-Ky for emacs-orgmode@gnu.org; Tue, 19 May 2009 14:20:05 -0400 Received: from [199.232.76.173] (port=42996 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6Tuy-0002aL-8D for emacs-orgmode@gnu.org; Tue, 19 May 2009 14:20:00 -0400 Received: from emh04.mail.saunalahti.fi ([62.142.5.110]:53819) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6Tux-0003YF-Oz for emacs-orgmode@gnu.org; Tue, 19 May 2009 14:20:00 -0400 Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh04-2.mail.saunalahti.fi (Postfix) with SMTP id 0D75713BD50 for ; Tue, 19 May 2009 21:19:57 +0300 (EEST) Received: from mail.djcbsoftware.nl (a88-113-10-89.elisa-laajakaista.fi [88.113.10.89]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 01B6C41BE7 for ; Tue, 19 May 2009 21:19:55 +0300 (EEST) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi all, I sometimes use blocks of code in my org-files; currently, to make them look nice, I put the code in a buffer with their major mode (e.g, a blog perl in a buffer with perl-mode), then convert it to html with htmlize, and copy the result html back in an org-mode html block. #+BEGIN_HTML

#+END_HTML

I seems that I should be able to automate that a bit... ie., maybe
something like:

#+BEGIN_CODE(perl)
print "hello, world!";
#+END_CODE

And *somehow* make that execute the steps I mentioned, and get something
like; so I'd need to cut-out only the stuff within 
 the
htmlize-generated html (it generates top-level html stuff which we
should ignore I guess).
 
print "hello, world!\n";
But I'm not really sure if that would be the best approach. Did anyone do something like this before? Any tips? Thanks, Dirk. -- Dirk-Jan C. Binnema Helsinki, Finland e:djcb@djcbsoftware.nl w:www.djcbsoftware.nl pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C