public
Description: Microformats Helper is a plugin for generating content-rich tags in HTML files, following Microformats standards. For more information about Microformats, check its website (http://microformats.org).
Homepage:
Clone URL: git://github.com/shadow11/microformats_helper.git
100644 60 lines (40 sloc) 1.574 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
=Microformats Helper
 
Microformats Helper is a plugin for generating content-rich tags in HTML files, following Microformats standards. For more information about Microformats, check its website (http://microformats.org).
 
Currently only the hCard microformat is available.
 
==Options
 
All fields are optional but the name, you are required to provide at least one of the names below.
 
===Name
 
* +fn+ - Formal Name: should be used when no other name is provided
* +given+ - Given Name
* +family+ - Family Name
* +additional+ - Additional Name: goes between given and family names
* +prefix+ - Honorific Prefix: for titles like Dr. or Sir
* +suffix+ - Honorific Suffix: for titles like M.D. or Jr
 
===Address
 
* +street+ - Street Address
* +locality+ - The city or similar
* +region+ - The state, county or similar
* +postal-code+ - ZIP number
* +country+ - The country
 
===Contact
 
* +tel+ - Provide the phone number
* +url+ - Add a link to a site in the name
* +email+ - Add a link to a mailto: address
 
 
==Usage
 
In your views:
 
  <%= hcard :fn => "Ricardo Yasuda" %>
 
The output is:
 
  <span class="vcard">
<span class="fn n">Ricardo Yasuda</span>
  </span>
 
A more complicated example:
 
  <%= hcard :given => "Ricardo", :family => "Yasuda", :url => "http://blog.shadowmaru.org", :country => "Brazil" %>
 
The output is:
 
  <span class="vcard">
<a href="http:blog.shadowmaru.org" class="fn n url">
<span class="given-name">Ricardo</span> <span class="family-name">Yasuda</span>
</a>
<div class="adr">
<span class="country-name">Brazil</span>
</div>
  </span>