From mboxrd@z Thu Jan 1 00:00:00 1970 From: tftorrey@tftorrey.com (T.F. Torrey) Subject: [new exporter] [html] Tables of Contents Date: Mon, 04 Mar 2013 12:57:28 -0700 Message-ID: <878v630wgn.fsf@lapcat.tftorrey.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCbY2-0008Ii-B9 for emacs-orgmode@gnu.org; Mon, 04 Mar 2013 14:59:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCbXx-00051Q-El for emacs-orgmode@gnu.org; Mon, 04 Mar 2013 14:59:46 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:36219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCbXx-00050y-7o for emacs-orgmode@gnu.org; Mon, 04 Mar 2013 14:59:41 -0500 Received: from mfilter17-d.gandi.net (mfilter17-d.gandi.net [217.70.178.145]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 0E069A80BB for ; Mon, 4 Mar 2013 20:59:30 +0100 (CET) Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter17-d.gandi.net (mfilter17-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id kP0ewiKDVAv3 for ; Mon, 4 Mar 2013 20:59:28 +0100 (CET) Received: from lapcat.tftorrey.com.tftorrey.com (ip70-190-16-163.ph.ph.cox.net [70.190.16.163]) (Authenticated sender: tftorrey@tftorrey.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 8DC2BA80B5 for ; Mon, 4 Mar 2013 20:58:10 +0100 (CET) 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 Hello, The new exporter currently puts the generated Table of Contents at the beginning of the exported document in addition to the location of "#+TOC: headlines". I don't think it should insert it at the beginning when it is called later. However, I think the new exporter introduces disparities in the output options that give us a chance to do something better. In the new exporter, the type of generated Table of Contents depends on two different configurations: 1. In the #+OPTIONS line, the toc: option determines whether to include a TOC at the beginning, and how many levels /any/ TOC's should have. 2. The keyword #+TOC: can also be used to insert a generated TOC at a specific location in the document. This keyword allows options of headlines, images, and listings, but it has no provision for levels. Currently, using the OPTION toc:nil suppresses a default TOC. Later on, the #+TOC keyword is still recognized and acted upon, which I think is the correct behavior, but then it includes all levels in the generated TOC, because there no way to tell it otherwise. IMHO, the #+OPTIONS line toc: option is unnecessary. However, if used, it should only provide the document default options for generated TOC's. Instead, the #+TOC keyword should be changed to support the plist structure that has been adopted elsewhere. Thus, an example might be: #+TOC: :type headlines :levels 2 Other options might be included, too, such as the option to suppress dates or TODO states as Carsten requested, or perhaps even user-supplied options, something like this: #+TOC: :type headlines :levels 2 :dates nil :todo nil :title nil :extra-function my-custom-toc-headline-processor (In this example, the :title property means the "Table of Contents" at the top of the TOC, not the title of the headline.) I don't know how the current options (or these I've proposed) could be designated in the OPTIONS line. If we dropped support for the toc: option in the OPTIONS line, people would have to insert the #+TOC: keyword with its options where they wanted it. Would that be so bad? I was going to post a bug report saying that the initial generated TOC should not be included if there was a following #+TOC line, but then I couldn't answer what to do if the later TOC was only images or listings. My proposal eliminates this problem. All the best, Terry -- T.F. Torrey