- From: Michael[tm] Smith <mike@w3.org>
- Date: Fri, 22 Mar 2013 05:47:58 +0900
- To: Silvia Pfeiffer <silviapfeiffer1@gmail.com>
- Cc: Robin Berjon <robin@w3.org>, public-html <public-html@w3.org>, Léonie Watson <tink@tink.co.uk>
Silvia Pfeiffer <silviapfeiffer1@gmail.com>, 2013-03-22 07:36 +1100:
> How about something more constructive such as an explicit <outline> element
> that creates a table of contents through the outline algorithm.
I think just adding a createOutline method would be better. It would return
an Outline object that's a tree of Section objects. The developer could
then choose what HTML they want to use to actually get the outline into the
DOM (e.g., ul/li or ol/li or whatever).
You could do document.document.element.createOutline() to get an Outline
object for the whole document, or document.getElementById("foo").createOutline()
(or with querySelector or whatever) to create an Outline object for some
portion of a document (one use case being if you want to generate
per-section or per-chapter TOCs in a long document).
--Mike
--
Michael[tm] Smith http://people.w3.org/mike
Received on Thursday, 21 March 2013 20:48:07 UTC