From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: html export with htmlized code blocks Date: Tue, 19 May 2009 15:10:01 -0400 Message-ID: <87skj0c3jq.fsf@stats.ox.ac.uk> References: <20090519181956.GD6662@mindcrime> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6UhY-0000iX-Ax for emacs-orgmode@gnu.org; Tue, 19 May 2009 15:10:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6UhT-0000i3-SR for emacs-orgmode@gnu.org; Tue, 19 May 2009 15:10:11 -0400 Received: from [199.232.76.173] (port=57667 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6UhT-0000i0-H6 for emacs-orgmode@gnu.org; Tue, 19 May 2009 15:10:07 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:42230) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M6UhT-0000Xb-2k for emacs-orgmode@gnu.org; Tue, 19 May 2009 15:10:07 -0400 In-Reply-To: <20090519181956.GD6662@mindcrime> (Dirk-Jan C. Binnema's message of "Tue, 19 May 2009 21:19:56 +0300") 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: djcb@djcbsoftware.nl Cc: emacs-orgmode@gnu.org "Dirk-Jan C. Binnema" writes: > 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? Hi Dirk, I think what you are describing is achieved by * some heading #+BEGIN_SRC perl print "hello, world!"; #+END_SRC Then you just export the buffer as HTML. See http://orgmode.org/manual/Literal-examples.html#Literal-examples Sorry if I've misunderstood. Dan > Any tips? > > Thanks, > Dirk.