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: Wed, 23 Jul 2014 21:51:10 -0400 Message-ID: <87ha27a5ip.fsf@gmail.com> References: <87zjg1gddd.fsf@fastmail.fm> <87wqb4amqb.fsf@gmail.com> <8738dshkdw.fsf@fastmail.fm> <8761io2jnz.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XA8Bw-0008Hz-00 for emacs-orgmode@gnu.org; Wed, 23 Jul 2014 21:51:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XA8Bq-00029H-HU for emacs-orgmode@gnu.org; Wed, 23 Jul 2014 21:51:31 -0400 Received: from plane.gmane.org ([80.91.229.3]:55296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XA8Bq-00028k-BD for emacs-orgmode@gnu.org; Wed, 23 Jul 2014 21:51:26 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XA8Bp-0002fk-5p for emacs-orgmode@gnu.org; Thu, 24 Jul 2014 03:51:25 +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 ; Thu, 24 Jul 2014 03:51:25 +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 ; Thu, 24 Jul 2014 03:51:25 +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 Charles Berry writes: > Matt Lundin imapmail.org> writes: > > [deleted] > >> Footnotes: >> >> [fn:1] If one really needs to see the headlines in the original org >> buffer, a hook can be used to remove the :RESULTS: drawer. >> >> --8<---------------cut here---------------start------------->8--- >> (defun my-remove-stray-results-drawer (backend) >> (when (eq backend 'html) >> (while (re-search-forward "^\\s-*:RESULTS:\\s-*\n" nil t) >> (replace-match "")))) >> >> (add-hook 'org-export-before-parsing-hook 'my-remove-results-drawer) >> --8<---------------cut here---------------end--------------->8--- >> >> > > Or wrap the results in a drawer when you type C-c C-c, but render them as > raw on export (which removes the drawer and replaces with raw results). > > Like so: > > #+header: :results (if (boundp 'backend) "raw" "drawer") > #+BEGIN_SRC emacs-lisp :exports both > > (format "* headline\n1\n2\n5\n") > #+END_SRC > That's a very nice tip - one small weakness is that it'll do the wrong thing if you just happen to have a binding for "backend" outside of the export mechanism. -- Nick