You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The spec says the Table of Contents is build out of non hidden hyperlinks under <nav role=doc-toc>. But what is it exactly, and what is it used for. the spec says this:
User Agents can use the Table of Contents for example to provide the user with an ordered collection of resources he/she can directly navigate to on demand.
That seems a little too simple, as Table of Contents often have structure and hierarchy, and this definition forgoes that.
This would be turned into a linear list: Tome 1, Ch1.1, Ch1.2, Tome 2, Ch2.1, Ch2.2. In this example, the list is short and the names reflect the hierarchy, so it is not too bad, but for a larger document it would not be very usable.
So, I think the ToC should not be a list, but it should be a tree. That way, the UA could still present a flat list if it wanted to by flattening the tree depth first, but it could also (and probably should) present it as a hierarchy, possibly with some UI to collapse sub-levels...
For example, here is a screenshot from a long & structured PDF I happen to be reading. A WebBook UA should be able to do a similar rendering of the ToC.
For this to be possible and interoperable given arbitrary markup, we need to define the precise algorithm to go from the DOM to the ToC tree.
I'm happy to write this in precises language if we agree on the general approach. As a general approach, I suggest:
<ol>, <ul>, <dl> increase the level of nesting, nothing else does
within one level of nesting all non hidden links go in document order
Possible alternative to 1: <ol>, <ul>, <dl> and sectioning content elements (article aside nav section) increase the level of nesting, nothing else does. I don't think I like this alternative, but I thought I'd just put it there for the sake of the discussion.
The text was updated successfully, but these errors were encountered:
The spec says the Table of Contents is build out of non hidden hyperlinks under
<nav role=doc-toc>
. But what is it exactly, and what is it used for. the spec says this:That seems a little too simple, as Table of Contents often have structure and hierarchy, and this definition forgoes that.
This would be turned into a linear list:
Tome 1, Ch1.1, Ch1.2, Tome 2, Ch2.1, Ch2.2
. In this example, the list is short and the names reflect the hierarchy, so it is not too bad, but for a larger document it would not be very usable.So, I think the ToC should not be a list, but it should be a tree. That way, the UA could still present a flat list if it wanted to by flattening the tree depth first, but it could also (and probably should) present it as a hierarchy, possibly with some UI to collapse sub-levels...
For example, here is a screenshot from a long & structured PDF I happen to be reading. A WebBook UA should be able to do a similar rendering of the ToC.
For this to be possible and interoperable given arbitrary markup, we need to define the precise algorithm to go from the DOM to the ToC tree.
I'm happy to write this in precises language if we agree on the general approach. As a general approach, I suggest:
<ol>
,<ul>
,<dl>
increase the level of nesting, nothing else doesPossible alternative to 1:
<ol>
,<ul>
,<dl>
and sectioning content elements (article aside nav section) increase the level of nesting, nothing else does. I don't think I like this alternative, but I thought I'd just put it there for the sake of the discussion.The text was updated successfully, but these errors were encountered: