hcard-implied-brainstorming: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
No edit summary
 
m (Replace <entry-title> with {{DISPLAYTITLE:}})
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<h1>Implied hCard Brainstorming</h1>
{{DISPLAYTITLE:Implied hCard Brainstorming}}


These are ideas for solutions to [[implied-hcard|implied-hcards]]. See [[implied-hcard-examples]] for use cases.
These are ideas for solutions to [[hcard-implied|implied-hcards]]. See [[hcard-implied-examples]] for use cases.


== Initial ideas ==
== Initial ideas ==
Line 34: Line 34:
* Extraordinarily simple markup
* Extraordinarily simple markup
* Provides a smaller barrier-to-entry for microformats that require hCard
* Provides a smaller barrier-to-entry for microformats that require hCard
Additionally, the @href could map to different properties based on protocol:
* <nowiki>[href^='http']</nowiki> would map to <code>url</code>
* <nowiki>[href^='mailto']</nowiki> would map to <code>email</code>
* <nowiki>[href^='data']</nowiki> would map to <code>photo</code>


--[[User:RCanine|Ryan Cannon]]
--[[User:RCanine|Ryan Cannon]]
==See also==
* [http://microformats.org/discuss/mail/microformats-discuss/2008-January/011199.html Mailing list discussion: January 2008]

Latest revision as of 16:26, 18 July 2020


These are ideas for solutions to implied-hcards. See hcard-implied-examples for use cases.

Initial ideas

The rule could be similar to:

If a an element with class=vcard does not have any hCard class names, imply the entire content as an fn field, and attempt to apply the implied "n" optimization.

Optionally, if the root element has @href, imply a class="url".

For example:

<a class="vcard" href="http://ryancannon.com/">Ryan Cannon</a>

becomes

BEGIN:VCARD
N:Cannon;Ryan;;;
FN:Ryan Cannon
URL:http\://ryancannon.com/
END:VCARD

All this is possible because it requires an hCard without hCard markup inside.

This is fairly powerful for a few reasons:

  • It does not require in-depth knowledge of hCard or vCard
  • Extraordinarily simple markup
  • Provides a smaller barrier-to-entry for microformats that require hCard

Additionally, the @href could map to different properties based on protocol:

  • [href^='http'] would map to url
  • [href^='mailto'] would map to email
  • [href^='data'] would map to photo

--Ryan Cannon

See also