bjuppa / macropiche

PHP tool for HTML display of view-templates (of a pattern library)
1 stars 0 forks source link

Suggestion: use <figure> as wrapping element #6

Closed bjuppa closed 8 years ago

bjuppa commented 8 years ago

The figure element represents some flow content, optionally with a caption, that is self-contained (like a complete sentence) and is typically referenced as a single unit from the main flow of the document.

Would it be appropriate to switch our self-contained helper-output's <div> into <figure> with the path wrapped in <figcaption>?

See examples in the spec: https://html.spec.whatwg.org/multipage/semantics.html#the-figure-element

bjuppa commented 8 years ago

Semantically I still think this seems appropriate, perhaps more so if only the code-display elements are wrapped in <figure>, and not the actual html-output (which could be considered part of the main flow - unless the whole <figure> is specifically mentioned outside the macropiche() output.

But there is a serious risk that a user stylesheet would do something to all figure elements, which would be undesirable here

With that in mind, and considering the very small semantic benefit (this started out as a desire to put some kind of proper label/caption/headline-tag around the file-path display element), my conclusion is that keeping the current (but less semantically specific) <div> around the whole output, and <a> around the file-path is probably better.