What are Microformats?
Microformats are a simple way to add more meaning to your HTML.
How do you use Microformats?
It's easy! You probably already know how. It's just classes.
Example: Contact Information
Example: Link to Person
Why use Microformats?
By adding Microformats to your HTML, your website becomes more understandable to various kinds of computers.
- Search engines can make sense of your HTML which allows them to display a better version in their search results.
- Browser extensions can enable your readers to download information to their contacts, calendar, and maps apps.
- Feed readers can be used to subscribe to your website's feeds (blog posts, bookmarks, checkins, etc).
- You can even use your website (with Microformats) to sign into other websites.
What else are they good for?
In addition to people and organizations, Microformats can be used for: feeds, blog posts, events, locations, reviews, recipes, resumes, and products.
Examples in the wild
Microformats are fully specced with a comprehensive test suite and are licensed as Public Domain allowing you to freely use them however you want.
If you're a developer working on an app or service, you probably need JSON as your input format. Don't worry. There are several Microformats parsers written in multiple programming languages. A parser will take a URL or a glob of HTML, understand it, then convert it to JSON for your use.
You can test your URL here (or HTML snippet on any of the parser sites).
Production ready parsers are available for: Go, Node, PHP, Python, Ruby.
Other parsers are in-development for: Erlang, Elixir, Haskell, Java, and more.
Example: Parsing Contact Information
- For further reading, head over to the Microformats community wiki.
- If you have questions, join the #microformats chat.
- If you have your own personal website (or want to!), check out the #indieweb community wiki and join the chat.