[whatwg] Headings and sections, role of H2-H6

On Thu, Apr 29, 2010 at 2:47 AM, Adrian Sutton <adrian.sutton at ephox.com> wrote:
> This is certainly true, but it lends support for both the old and the new
> models working in tandem. ?Essentially there are two key use-cases for
> content management systems:
>
> 1. Authors being able to easily create content items. ?As you note above,
> h1-h6 makes far more sense to authors than invisible section elements and
> are far easier to apply correctly. Essentially content authors expect things
> to work roughly like Microsoft Word which the old model of headings does and
> so they generally get it right (especially if you disable the ability to add
> inline font size styles so they can't build a heading look-a-like manually).
>
> 2. The CMS needs to be able to assemble various content items in fairly
> arbitrary ways but still get a sensible heading structure in the result.
>?The section element and the new heading model is an ideal solution for this
> case.
>
> A planet aggregator is a good example of this in action - each blog post is
> an entity to itself so would use headings starting at H1, but when
> aggregated the headings should start at H2 (or 3 or 4 depending on what else
> is on the aggregated page). ?So the blog author writes the post using H1-H6
> because it's easy (or section if they prefer) and the aggregator simply
> wraps each blog post in a <section> so the resulting heading structure still
> works.

Correct, the aggregation use-case was one of the big reasons for the
heading-level scoping.


> As I understand it, while the spec recommends using only H1 if you're using
> sections, it's still valid and well defined to use h1-h6 along with section.

Exactly.  I certainly use both - sections starting at <h1> within the
page template, and <h1>-<h6> in page content, because the former is
nesting-agnostic, but the latter is easy to generate with Markdown.

~TJ

Received on Thursday, 29 April 2010 08:12:26 UTC