W3C home > Mailing lists > Public > public-html@w3.org > March 2013

<outline> element or element.createOutline() method [was: Validity constraints on <section>]

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>
Message-ID: <20130321204758.GW13611@sideshowbarker>
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).


Michael[tm] Smith http://people.w3.org/mike
Received on Thursday, 21 March 2013 20:48:07 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:32 UTC