From mboxrd@z Thu Jan 1 00:00:00 1970 From: "G. Jay Kerns" Subject: how to both :body-only t and :table-of-contents t Date: Wed, 21 Sep 2011 15:40:48 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7BIT Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6SfP-0007Ga-CY for emacs-orgmode@gnu.org; Wed, 21 Sep 2011 15:41:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6SfO-0000Cs-FR for emacs-orgmode@gnu.org; Wed, 21 Sep 2011 15:41:11 -0400 Received: from ppoint3.cc.ysu.edu ([150.134.10.214]:40846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6SfO-0000Cg-Bk for emacs-orgmode@gnu.org; Wed, 21 Sep 2011 15:41:10 -0400 Received: from pps.filterd (ppoint3 [127.0.0.1]) by ppoint3.cc.ysu.edu (8.14.4/8.14.4) with SMTP id p8LJcM7X004087 for ; Wed, 21 Sep 2011 15:41:08 -0400 Received: from myysumail.ysu.edu (myysumail.cc.ysu.edu [150.134.10.132]) by ppoint3.cc.ysu.edu with ESMTP id yxhxfh7a1-1 for ; Wed, 21 Sep 2011 15:41:08 -0400 Received: from mail-yi0-f41.google.com ([209.85.218.41]) by myysumail.ysu.edu (Sun Java System Messaging Server 6.2-9.20 (built Jul 15 2010)) with ESMTPSA id <0LRW002B41CK0720@myysumail.ysu.edu> for emacs-orgmode@gnu.org; Wed, 21 Sep 2011 15:41:08 -0400 (EDT) Received: by yia25 with SMTP id 25so1722532yia.0 for ; Wed, 21 Sep 2011 12:41:08 -0700 (PDT) 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 Dear Org Mode list, First: congratulations on Org mode; it is truly dynamite. I am publishing a project to HTML for the purposes of Jekyll post-processing. For this, I need to set :body-only t so I can put the YAML frontmatter at the top of my file. However, I would also like to have the TOC exported (only), right after the tag, which it correctly does whenever :body-only isn't t. In other words, it looks like I am obliged to :body-only t which cuts out header/footer/TOC or I can NOT do :body-only t which will give me the TOC plus a bunch of extra stuff. My question: is it possible to do what I want? Is there some sort of YAML {{ page.toc }} that I'm missing somewhere, or is there some combination of publishing options that I've missed that will export an org file to an HTML file that looks like this: --- layout: default title: whatever --- Rest of exported content here....? Thanks for any advice, and again, THANK YOU to the Org Mode team. Best, Jay From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?SmFuIELDtmNrZXI=?= Subject: Re: how to both :body-only t and :table-of-contents t Date: Fri, 23 Sep 2011 09:51:11 +0200 Message-ID: <4E7C3A6F.9060007@jboecker.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R70XV-0000cz-Bv for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 03:51:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R70XT-0004Tk-Pd for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 03:51:17 -0400 Received: from smtp01.worldserver.net ([217.13.200.37]:45739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R70XT-0004Sv-Ks for emacs-orgmode@gnu.org; Fri, 23 Sep 2011 03:51:15 -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: "G. Jay Kerns" Cc: emacs-orgmode@gnu.org On 09/21/2011 09:40 PM, G. Jay Kerns wrote: > In other words, it looks like I am obliged to :body-only t which cuts > out header/footer/TOC or I can NOT do :body-only t which will give me > the TOC plus a bunch of extra stuff. > > My question: is it possible to do what I want? Is there some sort of > YAML {{ page.toc }} that I'm missing somewhere, or is there some > combination of publishing options that I've missed that will export an > org file to an HTML file that looks like this: 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, Jan 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