microformats2-brainstorming: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(make microformats syntax even simpler for the most-common of markup patterns and use-cases, a proper noun, a single hyperlink, a single image, a hyperlinked image)
(make implied properties consistent with microformats 2 property naming/prefixing conventions)
Line 8: Line 8:


==== name default property on all ====
==== name default property on all ====
* pick 'name' (take feedback from mailinglists, Google Rich Snippets, etc. as better to use 'name' instead of 'fn' - benefits outweigh costs) as the single required and thus implied property of *every* microformat. that is, make this part of the syntax - we're marking up proper nouns. [[User:Tantek|Tantek]] 14:50, 9 June 2011 (UTC)
* pick 'p-name' (per feedback from microformats mailing-lists over the years, Google Rich Snippets renaming, etc. as better to use 'name' instead of 'fn' - benefits outweigh costs) as the single required and thus implied property of *every* microformat. that is, make this part of the syntax - we're marking up proper nouns. [[User:Tantek|Tantek]] 14:50, 9 June 2011 (UTC)
** may not work for all microformats, e.g. how would [[adr]] or [[geo]] work with this?
** may not work for all microformats, e.g. how would [[adr]] or [[geo]] work with this?


use-cases: every single proper noun on any web page.
use-cases: every single proper noun on any web page.


to-do: try examples with organizations, events, products
to-do: try examples with organizations, events, products (however note that those are almost always capitalized thus implying proper noun / name semantics)


==== imply url property from root only a href ====
==== imply url property from root only a href ====
* imply 'url' property from a root class name only on an <a href>
* imply 'u-url' property from a root class name only on an <a href>
E.g.
E.g.
<source lang=html4strict>
<source lang=html4strict>
Line 32: Line 32:


==== imply name and photo properties from root only img ====
==== imply name and photo properties from root only img ====
* imply 'photo' property from a root class name only on an &lt;img src alt&gt;
* imply 'u-photo' property from a root class name only on an &lt;img src alt&gt;
E.g.
E.g.
<source lang=html4strict>
<source lang=html4strict>
Line 40: Line 40:
parses as:
parses as:
* microformat: h-card
* microformat: h-card
* implied 'name' from img alt: Chris Messina
* implied 'p-name' from img alt: Chris Messina
* implied 'photo' from img src: <nowiki>http://example.org/pic.jpg</nowiki>
* implied 'u-photo' from img src: <nowiki>http://example.org/pic.jpg</nowiki>


use-cases - nearly every social networking site that shows a grid of people without text already does so with img tags and their names in the alt attribute. most of those are linked too, which brings me to the next imply:
use-cases - nearly every social networking site that shows a grid of people without text already does so with img tags and their names in the alt attribute. most of those are linked too, which brings me to the next imply:
Line 57: Line 57:
parses as:
parses as:
* microformat: h-card
* microformat: h-card
* implied 'url' from a href: http://chrismessina.me/
* implied 'u-url' from a href: http://chrismessina.me/
* implied 'name' from img alt: Chris Messina
* implied 'p-name' from img alt: Chris Messina
* implied 'photo' from img src: <nowiki>http://example.org/pic.jpg</nowiki>
* implied 'u-photo' from img src: <nowiki>http://example.org/pic.jpg</nowiki>


use-cases - nearly every social networking site that shows a grid of people without text already does so with hyperlinked img tags and their names in the alt attribute.
use-cases - nearly every social networking site that shows a grid of people without text already does so with hyperlinked img tags and their names in the alt attribute.

Revision as of 15:33, 4 August 2011

This article is a stub. You can help the microformats.org wiki by expanding it.

Brainstorming experimental / undeveloped / rejected ideas for microformats-2.

further simplifications

more on allow root class name only

name default property on all

  • pick 'p-name' (per feedback from microformats mailing-lists over the years, Google Rich Snippets renaming, etc. as better to use 'name' instead of 'fn' - benefits outweigh costs) as the single required and thus implied property of *every* microformat. that is, make this part of the syntax - we're marking up proper nouns. Tantek 14:50, 9 June 2011 (UTC)
    • may not work for all microformats, e.g. how would adr or geo work with this?

use-cases: every single proper noun on any web page.

to-do: try examples with organizations, events, products (however note that those are almost always capitalized thus implying proper noun / name semantics)

imply url property from root only a href

  • imply 'u-url' property from a root class name only on an <a href>

E.g.

<a class="h-card" href="http://chrismessina.me/">Chris Messina</a>

parses as:

  • microformat: h-card
  • implied 'name' from root element contents: Chris Messina
  • implied 'url' from a href: http://chrismessina.me/

use-cases - nearly every link to a person ever like on blog posts, blog rolls etc. all the same data/use-cases that informed XFN.

to-do: try examples with organizations, events, products

imply name and photo properties from root only img

  • imply 'u-photo' property from a root class name only on an <img src alt>

E.g.

<img class="h-card" src="http://example.org/pic.jpg" alt="Chris Messina" />

parses as:

  • microformat: h-card
  • implied 'p-name' from img alt: Chris Messina
  • implied 'u-photo' from img src: http://example.org/pic.jpg

use-cases - nearly every social networking site that shows a grid of people without text already does so with img tags and their names in the alt attribute. most of those are linked too, which brings me to the next imply:

to-do: try examples with organizations, events, products

imply name and photo property from img only child of a href

Combining the above:

<a class="h-card" href="http://chrismessina.me/">
 <img src="http://example.org/pic.jpg" alt="Chris Messina" />
</a>

parses as:

  • microformat: h-card
  • implied 'u-url' from a href: http://chrismessina.me/
  • implied 'p-name' from img alt: Chris Messina
  • implied 'u-photo' from img src: http://example.org/pic.jpg

use-cases - nearly every social networking site that shows a grid of people without text already does so with hyperlinked img tags and their names in the alt attribute.

to-do: try examples with organizations, events, products

rejected ideas

n prefix for multiple numbers

Idea:

  • "n-*" for (one or more) numbers, e.g. "n-rating", "n-geo", leaving the semantics of more than one number up to specific format. e.g. for an "n-rating" inside an "h-review", the first number would presumably be the rating value, when only two numbers the second would be the "best" value (e.g. rated <span class="n-rating">3 out of 4</span>), when three numbers the second would be the "worst" and the third would be the "best" (e.g. <span class="n-rating">7.5 out of 1 to 10</span>). similarly "n-geo" would specify the first number to be the latitude and the second to be the longitude.

Rejected because while this *might* work for some properties in *English* it will NOT localize/internationalize well (orders of numbers in phrases change in different languages), and it will also limit the human expressivity of the plain text. Thanks to Ben Ward for this feedback at the 2011-06-02 microformats dinner. Tantek 14:25, 9 June 2011 (UTC)

see also