W3C home > Mailing lists > Public > public-html-comments@w3.org > January 2008

Table of contents tag for html 5?

From: Daniel Benamy <dbenamy@optonline.net>
Date: Tue, 22 Jan 2008 16:57:06 -0500
Message-ID: <1ca741370801221357j74b448e5reb23d9dbb2b15982@mail.gmail.com>
To: public-html-comments@w3.org

I was thinking it might be useful to have a table of contents tag
which would generate a table of contents for the page based on the
heading tags. The entries in the table would be links to the
appropriate spot in the document. So maybe this html:

....
<toc />

<h1>Foo</h1>
<p>I like foo.</p>

<h1>Bar</h1>
<p>Nice bar.</p>
<h2>Baz</h2>
<p>More text.</p>
....

would produce:

Table of Contents
* Foo
* Bar
   * Baz

Foo
I like foo.

Bar
Nice bar.

Baz
More text.

There could also be attributes which control how the table of contents
is generated, such as whether the entries are numbered or not or which
headings are included (all, only those after the <toc>, only those
before, only headings greater than n, etc.)

I did a quick search and didn't see anything like this been discussed.
Did I miss it? Does it make sense to anyone else?

Thanks,
Dan
Received on Wednesday, 23 January 2008 04:22:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:13:58 GMT