Microformats Made Simple

Emily P. Lewis
Technical Review by Tantek Çelik

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

Acknowledgments

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.

Contents

Chapter 1 Introduction

What Are Microformats?

Humans first, machines second

Meaning through semantics

Some Background

The Semantic Web

A brief history of microformats

Everyone’s doing it

Core Concepts

Basic syntax

Terminology

Design patterns

Global Benefits

SEO

Extensible data publishing

Standards

Simplicity

Styling hooks

Challenges

Usability and accessibility concerns

Unnecessary markup?

Adoption

Why a Book on Microformats?

Too techy

More conversational

Practical examples

Diplomacy and new developments

I heart microformats

Chapter 2 Defining Outlines: XOXO

What Is XOXO?

What’s the point?

Profile

Basic syntax

Practical markup

S5 presentation using <ol>

Site map using nested <ul>s

Table of contents using nested <ol>s

You did it!

Chapter 3 Defining Links: rel and rev

Link Relationships

rel

Formal specifications

Drafts

rev

VoteLinks

Combining Your Elementals

rel-nofollow and VoteLinks

rel-tag and rel-directory

Not Enough Benefit?

That’s All She Wrote

Chapter 4 Defining Relationships: XFN

What Is XFN?

Benefits of the social web

Benefits of identity consolidation

Everything has challenges

Profile

Syntax

Practical Markup

Blogroll using <ul>

XFN in natural language

Authoring Tools

Bye-bye Elementals, Hello Compounds

Chapter 5 Defining Bookmarks: xFolk

Enter Social Bookmarking

What Is xFolk?

And the benefits?

Profile

Syntax

Practical Markup

Simple bookmark list using <ul>

Bookmark list using nested <ul>s

xFolk in natural language

Combining Microformats: xFolk and VoteLinks

Adding VoteLinks

It’s your choice

Which Brings Us to the End

Chapter 6 Defining People, Organizations and Places: hCard

What Is hCard?

Electronic business cards

Wide adoption

Search and SEO

Profile

Syntax

What to use?

Practical Markup for People

hCard in natural language

Personal site/blog contact information

Blog comments using <ol>

Employee directory using <ol>

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

Authoring Tools

Just the Beginning

Chapter 7 Defining Events: hCalendar

What Is hCalendar?

Electronic calendars

hCalendar, it’s the new black

Search implications

Profile

Syntax

Practical Markup

Single-event listing

Single event using <dl>

Multiple events using nested lists

Calendar using <table>

hCalendar in natural language

Combining hCalendar and hCard

Authoring Tools

What’s Next?

Chapter 8 Defining Résumés: hResume

What Is hResume?

One résumé to rule them all

Recognizing the potential

Electronic business cards and calendars

Profile

Syntax

Practical Markup

Simple résumé

Detailed résumé

Authoring Tools

The Journey Continues

Chapter 9 Defining Syndicated Content: hAtom

What Is hAtom?

HTML syndication

Not a syndication format

Gaining traction

Profile

Syntax

Practical Markup

Single blog post

News-article archive using <ol>

Authoring Tools

Up and hAtom

Chapter 10 Defining Reviews: hReview

What Is hReview?

Distributed reviews

Google gets in the game

Before Google

Profile

Syntax

Practical Markup

Book review

Combining hReview and hAtom

Authoring Tools

Let Your Voice Be Heard

Chapter 11 Speed Round

hAudio: Defining Audio Recordings

Profile

Syntax

Practical markup

hRecipe: Defining Food and Beverage Recipes

Profile

Syntax

Practical markup

hProduct: Defining Consumer Products

Profile

Syntax

Practical markup

hMedia: Defining Media Files

Profile

Syntax

Practical markup

Finish Line

Chapter 12 Because Looks Matter

Styling Links

XFN

VoteLinks

Styling hCard

The CSS

The end result

Styling hCalendar

The CSS

The end result

Styling hAtom

The CSS

The end result

Styling hRecipe

The CSS

The end result

Limited Only to Your CSS Skills

That’s All Folks!

Half the Battle

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset