From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: How would you export one headline every time that you tangle the file? Date: Wed, 12 Aug 2015 18:34:26 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPhPd-0004n5-Jy for emacs-orgmode@gnu.org; Wed, 12 Aug 2015 21:34:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPhPZ-0002LK-Fy for emacs-orgmode@gnu.org; Wed, 12 Aug 2015 21:34:33 -0400 Received: from iport-acv5-out.ucsd.edu ([132.239.0.10]:32670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPhPZ-0002KE-7k for emacs-orgmode@gnu.org; Wed, 12 Aug 2015 21:34:29 -0400 In-Reply-To: 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: Grant Rettke Cc: "emacs-orgmode@gnu.org" On Wed, 12 Aug 2015, Grant Rettke wrote: > Good afternoon, > > I've got an org file. It has a bunch of headlines. There is on > headline names README. > > I want to do something every time I tangle the file. I want to: > > - Go to that headline > - Select set the region to the contents of that headline (org-mark-subtree) > - Export the contents using the Github Flavored Markup to the file README.md. > If this is a one-off, I'd write a babel block like this and put it under the headline of that subtree: #+NAME: tangle-and-export-readme #+BEGIN_SRC emacs-lisp :tangle no :exports none (org-babel-tangle) (require 'ox-gfm) (org-export-to-file 'gfm "README.md" nil t) #+END_SRC Then when you want to tangle, C-c C-v g tangle-and-export-readme RET C-c C-c y will do it. (Assuming contrib is on the load path, of course.) You can use TAB completion with `C-c C-v g'. HTH, Chuck