Wužiwar:Tlustulimu/hCard

Z Wikipedije, swobodneje encyklopedije

hCard (skrótšenka za jendźelski HTML vCard) je mikroformat zo by publikował kontaktowe detaile ludźi, firmow, organizacijow, a městnow, w (X)HTML, Atom, RSS, abo arbitrary XML. hCard to čini wužiwajo 1:1 reprezentaciju vCard (RFC 2426) kajkosćow a hódnotow.

It allows parsing tools (for example other websites, or Firefox's Operator extension) to extract the details, and display them using some other websites or mapping tools, index or search them, or to load them into an address book program.

Přikład[wobdźěłać | žórłowy tekst wobdźěłać]

Consider the HTML:

 <div>
   <div>Joe Doe</div>
   <div>Jo</div>
   <div>The Example Company</div>
   <div>604-555-1234</div>
   <a href="http://example.com/">http://example.com/</a>
 </div>

Z microformat markup, to je:

 <div class="vcard">
   <div class="fn">Joe Doe</div>
   <div class="nickname">Jo</div>
   <div class="org">The Example Company</div>
   <div class="tel">604-555-1234</div>
   <a class="url" href="http://example.com/">http://example.com/</a>
 </div>

Here the formal name (fn), organization (org), telephone number (tel) and web address (url) have been identified using specific class names; and the whole thing is wrapped in class="vcard" which indicate that the other classes form an hcard, and are not just coincidentally named. If the hCard is for an organisation or venue, the fn and org classes are used on the same element, as in <span class="fn org">Wikipedia</span> or <span class="fn org">Wembley Stadium</span>. Other, optional, hCard classes also exist.

It is now possible for software, for example browser plug-ins, to extract the information, and transfer it to other applications, such as an address book.

Geo + adr[wobdźěłać | žórłowy tekst wobdźěłać]

The Geo microformat is a part of the hCard specification, and is often used to include the coordinates of a location within an hCard.

The adr part of hCard can also be used as a stand-alone microformat.

Live example[wobdźěłać | žórłowy tekst wobdźěłać]

Here are the Wikimedia Foundation's contact details, as a live hCard:

Wikimedia Foundation Inc.
200 2nd Ave. South #358
St. Petersburg, FL 33701-4313
USA
Phone: +1-727-231-0101
Email:
Fax: +1-727-258-0207

The mark-up (wrapped for clarity) used is:

 <div class="vcard">
   <div class="fn org">Wikimedia Foundation Inc.</div>
   <div class="adr">
     <div class="street-address">200 2nd Ave. South #358</div>
     <div>
       <span class="locality">St. Petersburg</span>, 
       <span class="region">FL</span> <span class="postal-code">33701-4313</span>
     </div>
     <div class="country-name">USA</div>
   </div>
   <div>Phone: <span class="tel">+1-727-231-0101</span></div>
   <div>Email: <span class="email">info@wikimedia.org</span></div>
   <div>
     <span class="tel"><span class="type">Fax</span>: 
     <span class="value">+1-727-258-0207</span></span>
   </div>
 </div>


(Ordinarily, one would use

 <abbr class="region" title="Florida">FL</abbr>

so that the output included region="Florida", but the abbr element is not supported on Wikipedia.)

Note that, in this example, the formal name (fn) and organisation (org) properties are combined on one element, indicating that this is the hCard for an organisation, not a person.

Druhe atributy[wobdźěłać | žórłowy tekst wobdźěłać]

Other commonly used hCard attributes include

  • bday - a person's birth date
  • email
  • honorific-prefix
  • honorific-suffix
  • label - for non-granular addresses
  • logo
  • nickname
  • note - free text
  • photo
  • post-office-box

Hlej tež[wobdźěłać | žórłowy tekst wobdźěłać]

Referency[wobdźěłać | žórłowy tekst wobdźěłać]

Eksterne wotkazy[wobdźěłać | žórłowy tekst wobdźěłać]

Z Wikipedije, swobodneje encyklopedije