From mboxrd@z Thu Jan 1 00:00:00 1970 From: "G. Jay Kerns" Subject: Re: how to both :body-only t and :table-of-contents t Date: Fri, 23 Sep 2011 07:32:56 -0400 Message-ID: References: <4E7C3A6F.9060007@jboecker.de> Reply-To: gkerns@ysu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R740Q-0006C2-Q0 for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 07:33:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R740M-0002rt-JO for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 07:33:22 -0400 Received: from mail-gy0-f169.google.com ([209.85.160.169]:36530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R740M-0002rm-Gy for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 07:33:18 -0400 Received: by gya6 with SMTP id 6so2922981gya.0 for ; Fri, 23 Sep 2011 04:33:17 -0700 (PDT) In-Reply-To: <4E7C3A6F.9060007@jboecker.de> 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: =?UTF-8?Q?Jan_B=C3=B6cker?= Cc: emacs-orgmode@gnu.org Dear Jan On Fri, Sep 23, 2011 at 3:51 AM, Jan B=C3=B6cker = wrote: > > Hi Jay, > > I faced the same problem about a year ago. > See this thread in the mailing list archive: > > http://thread.gmane.org/gmane.emacs.orgmode/24227 > > The HTML exporter will refuse to include a TOC if body-only is t; the > atom exporter and a "send HTML messages with Wanderlust" hack relied on > that behaviour, which is why this was not changed in the official Org > repository. > > You can either apply the one-line patch I included in the linked thread > or ask Ian Barton about his solution using jQuery he mentioned at the > end of that thread. > > HTH, > =C2=A0Jan > Thanks; I was afraid it was going to be something like that, and am appreciative that I don't need to reinvent this particular wheel. My previous workaround was to export once with TOC, copy-paste the TOC bit to the org-file in a #+BEGIN_HTML block, then export again with :body-only t. But each run takes a couple of hours (another question for another day), which is a pain, and not convenient should the document structure change. I noticed in the thread that Carsten mentioned writing a "hook" that strips the other stuff. Don't have much experience writing hooks, but there should be a way to write a custom publishing function just like the current one which strips everything but the TOC. I'll use your patch while I continue thinking about it. Thanks again. Jay