From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: How would you export one headline every time that you tangle the file? Date: Thu, 13 Aug 2015 10:14:18 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPtGy-0007I3-70 for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 10:14:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPtGu-0008T2-QD for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 10:14:24 -0400 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:32861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPtGu-0008Sl-MD for emacs-orgmode@gnu.org; Thu, 13 Aug 2015 10:14:20 -0400 Received: by qkfj126 with SMTP id j126so15754327qkf.0 for ; Thu, 13 Aug 2015 07:14:19 -0700 (PDT) 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: "Charles C. Berry" Cc: "emacs-orgmode@gnu.org" , Grant Rettke I also do something like this for scientific manuscripts, but I usually put it in a heading at the end and tag the heading :noexport:. that gives me some more flexibility to have multiple steps, some notes, etc... e.g. * build :noexport: #+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 Charles C. Berry writes: > 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 -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu