From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Possible to use src block to generate org headlines for export? Date: Tue, 22 Jul 2014 21:27:08 -0400 Message-ID: <87wqb4amqb.fsf@gmail.com> References: <87zjg1gddd.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9lL5-0003VQ-1M for emacs-orgmode@gnu.org; Tue, 22 Jul 2014 21:27:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9lKz-0001UC-AK for emacs-orgmode@gnu.org; Tue, 22 Jul 2014 21:27:26 -0400 Received: from plane.gmane.org ([80.91.229.3]:51765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9lKz-0001U6-40 for emacs-orgmode@gnu.org; Tue, 22 Jul 2014 21:27:21 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X9lKy-0004wi-1W for emacs-orgmode@gnu.org; Wed, 23 Jul 2014 03:27:20 +0200 Received: from pool-98-110-160-12.bstnma.fios.verizon.net ([98.110.160.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Jul 2014 03:27:20 +0200 Received: from ndokos by pool-98-110-160-12.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Jul 2014 03:27:20 +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 Matt Lundin writes: > I am attempting to use a babel code snippet to generate org headlines > for export. However, I seem to be running into a corner case here. > > AFAICT, the only way to generate headlines safely with babel is to wrap > them in a :RESULTS: drawer. > > Take the following example: > > #+BEGIN_SRC perl :export results :results output org drawer > print "* Headline One\n"; > print "* Headline Two\n"; > print "* Headline Three\n"; > #+END_SRC > > > If I hit the source block, it creates wraps the output in a drawer. This > protects the results, so when executing the source block again, babel > correctly detects the drawer and replaces the output rather than > multiplying it indefinitely, as it does with "raw". > > #+RESULTS: > :RESULTS: > * Headline One > * Headline Two > * Headline Three > :END: > > > The problem with the results drawer is that org-element (and thus ox.el) > does not recognize it as a drawer and thus includes :RESULTS: in the > export. The html output looks like this: > >

> :RESULTS: >

>
>

1 Headline One

>
>
>

2 Headline Two

>
>
>

3 Headline Three

>
>
>
> > > In short, is there a more graceful and export-friendly way to use babel > to generate org headlines for export? Or is there an easy way to get the > export backend to delete the opening part of the drawer (i.e., > :RESULTS:)? > > Any advice would be greatly appreciated. > No solace for your pain alas. See http://thread.gmane.org/gmane.emacs.orgmode/88557 My suggestion (as it was for Ronald, except that he had already rejected it :-) ) would be to use raw: you lose the idempotency of results production, but I don't know of any other problems. -- Nick