Difference between revisions of "microformats2-linting"

From Microformats Wiki
Jump to navigation Jump to search
(created published updated)
(→‎Notes: response to tantek)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
 
# If a document has an <var>h-feed</var> class, it shouldn't have any <var>h-entry</var> elements that are not children of the <var>h-feed</var>.
 
# If a document has an <var>h-feed</var> class, it shouldn't have any <var>h-entry</var> elements that are not children of the <var>h-feed</var>.
 
# A non-nested <var>h-entry</var> should be on an article.
 
# A non-nested <var>h-entry</var> should be on an article.
 +
#* -1 [[User:Tantek|Tantek]] 14:44, 12 July 2015 (UTC) see below
 
# If the outer <var>h-entry</var> is an article element, arguably nested <var>h-entry</var>s should also be articles. This is explicitly recommended by §4.3.2 of HTML5.
 
# If the outer <var>h-entry</var> is an article element, arguably nested <var>h-entry</var>s should also be articles. This is explicitly recommended by §4.3.2 of HTML5.
 +
#* -1 article tag is unnecessary extra markup / and or constraint for the semantics of h-entry. [[User:Tantek|Tantek]] 14:44, 12 July 2015 (UTC)
 
# <var>dt-created</var> <= <var>dt-published</var> <= <var>dt-updated</var>.
 
# <var>dt-created</var> <= <var>dt-published</var> <= <var>dt-updated</var>.
 +
 +
== Notes ==
 +
* <code>&lt;article&gt;</code> in practice seems to serve no purpose in HTML5.
 +
** I've stopped using it for this reason. [[User:Tantek|Tantek]] 14:44, 12 July 2015 (UTC)
 +
** I use it because it's the correct element for the job. There's a bit of a chicken and egg problem here: we ask for the new elements, WHATWG/W3C give them to us as blank slates to play with, then we complain that they don't do anything. And the semantics of an h-entry and an article match up pretty damn well. My view is that the point of a linter is to give people the hints to get better at writing not just microformats but at writing HTML too. You can ignore its advice if you choose though. —[[User:TomMorris|Tom Morris]] 14:57, 12 July 2015 (UTC)

Latest revision as of 14:57, 12 July 2015

This page is to work out possible rules for a future microformats2 linter/validator.

The job of a linter or validator is to help the user correctly implement microformats2 on their site by making helpful (if somewhat pedantic) comments about the markup.

Possible linting rules

  1. If a document has an h-feed class, it shouldn't have any h-entry elements that are not children of the h-feed.
  2. A non-nested h-entry should be on an article.
    • -1 Tantek 14:44, 12 July 2015 (UTC) see below
  3. If the outer h-entry is an article element, arguably nested h-entrys should also be articles. This is explicitly recommended by §4.3.2 of HTML5.
    • -1 article tag is unnecessary extra markup / and or constraint for the semantics of h-entry. Tantek 14:44, 12 July 2015 (UTC)
  4. dt-created <= dt-published <= dt-updated.

Notes

  • <article> in practice seems to serve no purpose in HTML5.
    • I've stopped using it for this reason. Tantek 14:44, 12 July 2015 (UTC)
    • I use it because it's the correct element for the job. There's a bit of a chicken and egg problem here: we ask for the new elements, WHATWG/W3C give them to us as blank slates to play with, then we complain that they don't do anything. And the semantics of an h-entry and an article match up pretty damn well. My view is that the point of a linter is to give people the hints to get better at writing not just microformats but at writing HTML too. You can ignore its advice if you choose though. —Tom Morris 14:57, 12 July 2015 (UTC)