microformats
This article is a stub. You can help the IndieWeb wiki by expanding it.
microformats are extensions to HTML for marking up notes, people, organizations, events, locations, blog posts, products, reviews, resumés, recipes etc. Sites use microformats to publish a standard API that is consumed and used by search engines, aggregators, and other tools.
microformats2 (aka mf2) is the latest stable and interoperable version of microformats. Most parsers and tools should support backwards compatibility for prior versions of microformats.
Why
Adding microformats classes to your existing HTML is a quick and easy way to allow tools like feed readers to use structured data from your site, without having to publish fragile sidefiles.
For vocabulary-specific reasons and use cases, see the following:
How
Guides and examples on how to publish microformats:
- Getting Started with microformats 2
- The “how” sections on pages for each format, e.g.
- …
Resources for consuming microformats:
IndieWeb Use
The IndieWeb makes heavy use of:
- h-card to mark up profiles and authors in published posts, then consumed by code (e.g. reply-contexts, readers) for authorship and more.
- h-entry to markup posts, replies, etc., then consumed by code for displaying, summarizing, replying.
- h-feed to create feeds of published posts on a blog or feeds of collections of information.
- in-reply-to to markup links from replies to original posts, then consumed by code for displaying comments, comment threads, etc.
- XFN for relationships, and identity consolidation (rel=me), consumed by code for IndieAuth etc.
Other formats are in use by IndieWeb community members. See resumé for examples of the h-resume microformat in use.
Implementations
There is a fuller list of implementations on the microformats wiki. Here are some used by the indieweb community:
- Most Webmention receivers will parse Microformats when receiving webmentions for replies
- indiewebify me - a step by step markup guide and validator
- unmung - a feed to mf2 transalator, and an mf2 parser based on mf2py
- pin13.net - Aaron's PHP-based parser.
FAQ
Are microformats an API
Q: Are microformats an API?
A: No, microformats are more like the information returned from an API.
HTTP GET of a particular URL of a website can be an API. microformats in the resulting HTML provide the information you might otherwise get from a bespoke API.
Thus combining HTTP, good site URL design, and microformats, your site can be your API. No separate XML/RDF/JSON/??? API endpoints needed. At least for readonly. For a write "API", see micropub.
A: Actually, yes, microformats are the simplest way of providing a read-only API, also known as "your website is your API".
Why not APIs
Q: Why not APIs instead of microformats?
A: See API, in short:
- secondary URLs
- secondary formats
- API key
- TOS requirements
- Unique snowflakes
- Complexity
- Fragility
See Also
- microformats2
- micropub
- http://microformats.org/wiki/
- tools
- Microformats philosophy & methodology summarized by Mark Pilgrim: http://microformats.org/discuss/mail/microformats-discuss/2005-October/001175.html