Matt Lundin <m...@imapmail.org> 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: > > <p> > :RESULTS: > </p> > <div id="outline-container-sec-1" class="outline-2"> > <h2 id="sec-1"><span class="section-number-2">1</span> Headline One</h2> > </div> > <div id="outline-container-sec-2" class="outline-2"> > <h2 id="sec-2"><span class="section-number-2">2</span> Headline Two</h2> > </div> > <div id="outline-container-sec-3" class="outline-2"> > <h2 id="sec-3"><span class="section-number-2">3</span> Headline Three</h2> > <div class="outline-text-2" id="text-3"> > </div> > </div> > </div> > > 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