From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: Exporting each subtree, including the headline? Date: Wed, 17 Oct 2018 08:58:09 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008268bd0578673339" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCfn7-0001PJ-0w for emacs-orgmode@gnu.org; Wed, 17 Oct 2018 02:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCfn5-0003nm-9F for emacs-orgmode@gnu.org; Wed, 17 Oct 2018 02:58:48 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:42112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCfn5-0003kJ-0W for emacs-orgmode@gnu.org; Wed, 17 Oct 2018 02:58:47 -0400 Received: by mail-ed1-x532.google.com with SMTP id b7-v6so23750069edd.9 for ; Tue, 16 Oct 2018 23:58:45 -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" To: Org-mode --0000000000008268bd0578673339 Content-Type: text/plain; charset="UTF-8" Hi again, Just for the record, I figured out the solution to this. I had to modify the function to run org-mark-subtree on each element before calling the export function - this way, the whole selected region is exported, including the headline. If anyone is interested, you can see my final leanpub-export function here: https://github.com/zzamboni/dot-emacs/blob/master/init.org#publishing-to-leanpub Best, --Diego On Mon, Oct 15, 2018 at 8:20 PM Diego Zamboni wrote: > Hi, > > I am working on publishing a book using LeanPub ( > https://leanpub.com/learning-hammerspoon/), produced from an Org source > file. I am trying to use the code from > https://medium.com/@lakshminp/publishing-a-book-using-org-mode-9e817a56d144, > which you can see here: > https://gist.githubusercontent.com/badri/4d1bf1f0a24e8db5065e31946355cfe3/raw/86889ba22e381252e11aa3a8678f31023aa10f7e/leanpub-export.el > > The code works, and each resulting file (one per top-level subtree) > contains the corresponding section, but without the headline. I would like > the headling to be exported as well. > > I have been looking around and found this: > https://emacs.stackexchange.com/a/2260. This code exports each section > including its headline, but each file contains the corresponding section > PLUS everything after it. > > I've been poking around the org functions, but I haven't been able to > figure this out. Any ideas? > > Thanks in advance, > --Diego > > --0000000000008268bd0578673339 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi again,

Just for the= record, I figured out the solution to this. I had to modify the function t= o run org-mark-subtree on each element before calling the export function -= this way, the whole selected region is exported, including the headline.

If anyone is interested, you can see my final leanp= ub-export function here:=C2=A0https://github.com/zzamboni= /dot-emacs/blob/master/init.org#publishing-to-leanpub

Best,
--Diego


On Mon, Oct 15, 2018 at 8:20 PM Diego = Zamboni <diego@zzamboni.org>= ; wrote:
Hi,

I am working on publishing a book using LeanPub (<= a href=3D"https://leanpub.com/learning-hammerspoon/" target=3D"_blank">http= s://leanpub.com/learning-hammerspoon/), produced from an Org source fil= e. I am trying to use the code from=C2=A0htt= ps://medium.com/@lakshminp/publishing-a-book-using-org-mode-9e817a56d144, which you can see here:=C2=A0https://gist.githubusercon= tent.com/badri/4d1bf1f0a24e8db5065e31946355cfe3/raw/86889ba22e381252e11aa3a= 8678f31023aa10f7e/leanpub-export.el

The code w= orks, and each resulting file (one per top-level subtree) contains the corr= esponding section, but without the headline. I would like the headling to b= e exported as well.

I have been looking around and= found this:=C2=A0https://emacs.stackexchange.com/a/2260. This code exports e= ach section including its headline, but each file contains the correspondin= g section PLUS everything after it.

I've been = poking around the org functions, but I haven't been able to figure this= out. Any ideas?

Thanks in advance,
--Di= ego

--0000000000008268bd0578673339--