Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this questionDo you use microformats in your web projects?
If yes then why? If no then why?
If yes then for which things do you use?
Is there any alternate of microformats in HTML 5 ?
I haven't used microformats yet. Should i start to use now or not much need?
I’ve used microformats fairly extensively. The benefits I see are
- access to data for robots like Google Rich Snippets
- access to data for users via µF-comsuming tools like H2VX
- (some) data validation
- more meaningful markup, which makes me happy
(minor) disadvantages are
- time; hand-coding these things can be a pita. Either add programmatically (e.g. generate from data in CMS) or make a bunch of snippets. If doing via a CMS then it’s (for me) a no-brainer
- require extra attention to UI to do well (best if exposed, but that often involves custom icon etc)
Microformats work fine as-is in HTML5. There are new HTML5 elements that map well to some µF functions, notably <time>
, but be warned that current µF tools generally can’t cope with HTML5’s new elements (“Tool support” slide).
Your other alternatives are HTML5’s microdata, and RDFa. Microdata is pretty nice, but quite new so doesn’t have many tools available. You can represent microformats in microdata, and the HTML5 spec has microdata versions of vCard and vCal. There’s also HTML5’s data-
attribute, but that’s for private use and doesn’t encode visible data, so is probably not what you’re after.
I perceive these three as a continuum from easy but specific (microformats) to hard but capable of anything (RDFa), with microdata (for me) occupying a sweet spot in the middle. Google Rich Snippets can read data in any of these, but user tools are still playing catchup. The main benefit of any of these is making your content more usable by exposing more of the information, and for me that’s generally worth the time.
For completeness I’ve used
- hCard
- hCalendar
- hEvent
- hAtom
- hReview (once? :)
- XFN
- plus some rels like rel-license
EDIT: I’ve written these articles on HTML5Doctor with everything you need to know ;)
- Extending HTML — Microformats
- Extending HTML — Microdata
HTH
You should ask Jeff Atwood.
HTML5 defines various semantic tags to mark your data:
<time>
<address>
<header>
<nav>
<footer>
<article>
<summary>
<details>
It also allows for custom data attributes starting with "data-"
within elements.
There is support for microdata which is based on microformats to provide more semantic structure to individual and groups of elements.
And to answer your main question:
No, I don't microformats because I didn't see the advantages until I gave your question a serious thought. I am using the newer HTML5 elements such as time, and custom data attributes, but not microformats because the data was already structured on the backend, and for more structured and semantic access, I'd would've used RSS feeds with specific extensions and include a link to the feed within the document itself.
That said, here's why I still support microformats and believe they are awesome and will most likely start using it in the very near future. For me, it serves a very specific purpose and has to do with programmatic access to the elements within my web applications. RSS and Atom feeds provide the same data in a very structured manner, but it's an alternative view. Microformats, or any other homegrown standards can be used effectively to enhance applications.
As long as the elements are structured in a standard manner, I can build upon a shared library of reusable code across all applications that deals with commonly occurring data items such as names, addresses, contact details, telephone numbers, etc. to enhance all applications. For example, automatically linking addresses to Google Maps, or linkifying telephone numbers to use a native protocol such as tel:
on the fly for mobile devices and various other enhancements that I can do.
精彩评论