Microformats Made Simple
Emily P. Lewis
New Riders
1249 Eighth Street
Berkeley, CA 94710
510/524-2178
510/524-2221 (fax)
Find us on the web at: www.newriders.com
To report errors, please send a note to [email protected]
New Riders is an imprint of Peachpit, a division of Pearson Education.
Copyright @ 2010 by Emily Lewis
Acquisition and Development Editor: Wendy Sharp
Copy Editor: Jacqueline Aaron
Production Editor: Myrna Vladic
Compositor: David Van Ness
Indexer: Emily Glossbrenner, FireCrystal Communications
Cover Design: Mimi Heft
Interior Design: Kathleen Cunningham
Notice of Rights
All rights reserved. No part of this book may be reproduced or transmitted in any form by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. For information on getting permission for reprints and excerpts, contact [email protected].
Notice of Liability
The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of the book, neither the author nor Peachpit shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the instructions contained in this book or by the computer software and hardware products described in it.
Trademarks
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and Peachpit was aware of a trademark claim, the designations appear as requested by the owner of the trademark. All other product names and services identified throughout this book are used in editorial fashion only and for the benefit of such companies with no intention of infringement of the trademark. No such use, or the use of any trade name, is intended to convey endorsement or other affiliation with this book.
ISBN 13: 978-0-321-66077-0
ISBN 10: 0-321-66077-3
9 8 7 6 5 4 3 2 1
Printed and bound in the United States of America
To Tantek Çelik, not only for lending his technical expertise, but also for all his work making microformats a reality and for his ongoing advocacy.
To everyone at Peachpit New Riders who had a hand in the creation of this book, especially Jacqueline Aaron and Wendy Sharp. And a special thanks to Wendy for taking a chance on a new author and being patient with and supportive of me as I learned how to write this book.
To Jason Nakai, for coming up with designs for my CSS chapter on very short notice and for being my safe place to fall when I thought I was going to completely lose my mind.
To Ian Pitts, for being the best boss I’ve ever had and for encouraging me to continually push my skills and knowledge.
To my colleagues, friends, and family who have provided unwavering support, not only for this book but also for me as I expand my horizons: Erin Lewis, Erin Shutes, Jen Schwedler, Tracy Teague, Theresa Ball, Chris Harrison, Virginia DeBolt, Chris Kenworthy, Trevor Gryffyn, Mark Casias, Suellen Maneely, Laurie Varela, Sarah Mitchell, Chris Heilmann, Jeff Croft, Jeremy Keith, Jason Beaird, Jeremy Abbott, Joe Lewis, Ben Ward, Stephanie Sullivan, and Andy Clarke.
To the designers, developers, and fellow web geeks who inspire me and keep the bar high: Greg Storey, D. Keith Robinson, Dan Rubin, Nick Finck, Leslie Camacho, Nevin Lyne, J. Cornelius, Derek Featherstone, Lea Alcantara, Ryan Irelan, Jonathan Snook, Ryan Masuga, Whitney Hess, Rob Jones, Chris Pederick, Jason Santa Maria, James Craig, Eric Meyer, Jeffrey Zeldman, Michael Boyink, Cameron Moll, Ethan Marcotte, Roger Johansson, Shaun Inman, Molly Holzschlag, Andy Budd, Simon Collison, Doug Bowman, Dave Shea, Chris Messina, John Allsopp, Dan Cederholm, Aaron Walter, Nicole Sullivan, and dozens of others.
To the readers of A Blog Not Limited and all my social-network friends, for being interested in what I have to say and spreading the word.
To my local community of geeks, especially Webuquerque and ABQ Web Geeks, for keeping me sane, engaged, and full of beer twice a month.
To anyone I overlooked, you know I love you.
And finally, to you. Thank you for reading! I hope you enjoy the book and learn a little something in the process.
A brief history of microformats
Usability and accessibility concerns
Diplomacy and new developments
Chapter 2 Defining Outlines: XOXO
Table of contents using nested <ol>
s
Chapter 3 Defining Links: rel and rev
Chapter 4 Defining Relationships: XFN
Benefits of identity consolidation
Bye-bye Elementals, Hello Compounds
Chapter 5 Defining Bookmarks: xFolk
Simple bookmark list using <ul>
Bookmark list using nested <ul>
s
Combining Microformats: xFolk and VoteLinks
Chapter 6 Defining People, Organizations and Places: hCard
Personal site/blog contact information
Practical Markup for Organizations (and Places)
Corporate-site contact information using <dl>
Corporate directory for multiple branches using <dl>
Natural language for a named place
Chapter 7 Defining Events: hCalendar
Multiple events using nested lists
Chapter 8 Defining Résumés: hResume
Electronic business cards and calendars
Chapter 9 Defining Syndicated Content: hAtom
News-article archive using <ol>
Chapter 10 Defining Reviews: hReview
hAudio: Defining Audio Recordings
hRecipe: Defining Food and Beverage Recipes
hProduct: Defining Consumer Products
Chapter 12 Because Looks Matter