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: Wed, 06 Mar 2013 02:51:09 -0700 Message-ID: <87r4jszwj6.fsf@lapcat.tftorrey.com> References: <87obexb1rp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:32852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDB0o-0004DZ-R9 for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 04:51:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDB0n-0000fN-E2 for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 04:51:50 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:52616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDB0n-0000f9-72 for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 04:51:49 -0500 In-Reply-To: <87obexb1rp.fsf@gmail.com> (message from Jambunathan K on Wed, 06 Mar 2013 09:47:14 +0530) 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: Jambunathan K Cc: emacs-orgmode@gnu.org, n.goaziou@gmail.com Hello Jambunathan, Jambunathan K writes: > Torrey > >>>> 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? > > Why do you need two table of contents? I don't, though some might. As was explained earlier in this thread, if toc: options are set in the OPTIONS line, and a #+TOC is specified later, two tables of contents are generated, and they have the same ID. It is a feature of the new exporter, but duplicate ID's are not valid in XML. It is common for technical manuals to have a top-level table of contents at the front of the manual and a detailed table of contents later on. For instance, the GNU project Info manuals have that structure. >> 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. > > This seems like a valid use-case. > > I would recommend that you just specify just the use-case and leave out > the "how"s of implementation. > > Put your user hat and set aside the developer's hat. What a strange, semi-insulting thing to say. And misguided, too, as I was suggesting a design, not its implementation. As someone with all my own documents in Org and extensive experience developing XSLT and lisp to process the XHTML output of Org, I appreciate when the design of the HTML output is logical and useful. I would rather see a good design implemented in hacks than a poor design implemented in beautiful code. Regards, Terry -- T.F. Torrey