From mboxrd@z Thu Jan 1 00:00:00 1970 From: tftorrey@tftorrey.com (T.F. Torrey) Subject: Re: [new exporter] [html] Tables of Contents Date: Tue, 05 Mar 2013 13:21:00 -0700 Message-ID: <87txopzjgz.fsf@lapcat.tftorrey.com> References: <8738wauvt0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCyMi-0001Ay-KK for emacs-orgmode@gnu.org; Tue, 05 Mar 2013 15:21:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCyMh-0006Oh-AI for emacs-orgmode@gnu.org; Tue, 05 Mar 2013 15:21:36 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCyMh-0006OT-34 for emacs-orgmode@gnu.org; Tue, 05 Mar 2013 15:21:35 -0500 In-Reply-To: <8738wauvt0.fsf@gmail.com> (message from Nicolas Goaziou on Tue, 05 Mar 2013 08:53:31 +0100) 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > tftorrey@tftorrey.com (T.F. Torrey) writes: > >> One small problem, though: I see that if there is a TOC at the top and >> then one included later using #+TOC, the exporter gives them both the >> same id (
). Duplicate ID's makes the XML >> invalid. > > What do you suggest instead? id="table-of-contents-1" for the first > #+TOC: keyword and so on? > > > Regards, If I were implementing this with abundant resources, I'd probably opt for a schema of base-type[-levels][-sequence], with these definitions: - base :: probably "toc" to group and identify these id's - type :: "headlines", "images", or other current or future types - level :: depth of map, if it makes sense for the type - sequence :: if necessary, the number of the copy of this configuration in this document This schema would produce id's such as these: - toc-headlines-1 :: lone instance of toc/headlines/one level - toc-headlines-2 :: lone instance of toc/headlines/two levels - toc-headlines-2-2 :: second instance of toc/headlines/two levels - toc-images :: lone instance of toc/images (do levels make sense?) - toc-tables :: first instance of list of tables - toc-tables-2 :: second instance of list of tables You get the idea. This gives a significant advantage in that authors can link to the various instances just by knowing their own usage. For instance, if they provided a top-level toc at the beginning of their book, and a deeper-level toc later on, they could link to each separately by id by knowing this plan. Another idea for achieving the same linkability without the plan, would be to support assigning an id in the plist (that isn't implemented yet), such as "#+TOC: :type headlines :levels 2 :id toc-headlines-2". With this power would come the responsibility for the users to make sure id's were not duplicated. As a minimum, your suggestion ("table-of-contents-1", etc.) would be reasonable for most use cases, and it's the shortest route to valid XML. Some users of Org are producing complex documents that will probably be active users of multiple toc types. I'm curious what kind of schema would work best for their use cases. Best regards, Terry -- T.F. Torrey