emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tftorrey@tftorrey.com (T.F. Torrey)
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [new exporter] [html] Tables of Contents
Date: Tue, 05 Mar 2013 13:21:00 -0700	[thread overview]
Message-ID: <87txopzjgz.fsf@lapcat.tftorrey.com> (raw)
In-Reply-To: <8738wauvt0.fsf@gmail.com> (message from Nicolas Goaziou on Tue, 05 Mar 2013 08:53:31 +0100)

Nicolas Goaziou <n.goaziou@gmail.com> 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 (<div id="table-of-contents">).  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

  reply	other threads:[~2013-03-05 20:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 19:57 [new exporter] [html] Tables of Contents T.F. Torrey
2013-03-04 20:30 ` Nicolas Goaziou
2013-03-04 23:10   ` T.F. Torrey
2013-03-05  7:53     ` Nicolas Goaziou
2013-03-05 20:21       ` T.F. Torrey [this message]
2013-03-06  4:17         ` Jambunathan K
2013-03-06  4:36           ` Jambunathan K
2013-03-06 12:04             ` Jambunathan K
2013-03-06 21:37               ` T.F. Torrey
2013-03-07  7:57                 ` Jambunathan K
2013-03-06  9:51           ` T.F. Torrey
2013-03-06 10:10             ` Jambunathan K
2013-03-06 20:59               ` T.F. Torrey
2013-03-06 22:42                 ` Bastien
2013-03-07  0:27                   ` Jambunathan K
2013-03-07  9:10                     ` Bastien
2013-03-07  9:24                       ` Jambunathan K
2013-03-10  5:20                   ` Samuel Wales
2013-03-10  5:42                     ` Jambunathan K
2013-03-10  9:35                     ` Bastien
2013-03-07  0:33                 ` Jambunathan K
2013-03-06 10:35             ` Jambunathan K
2013-03-06 21:21               ` T.F. Torrey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txopzjgz.fsf@lapcat.tftorrey.com \
    --to=tftorrey@tftorrey.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).