Share
Embed
Microformats or: How I Learned to Write POSH and Love the Semantic Web
Session for In Control Orlando, covering the basics and benefits of microformats, as well as examples and exercises to help publish microformats (XFN, hCard and hCalendar). Also includes a discussion about POSH, HTML5 and ARIA roles.
Emily Lewis
October 04, 2011
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
133 slides
-
Some rights reserved. Microformats Emily Lewis In Control February 22,
2011 or: How I Learned to Write POSH and Love the Semantic Web -
Today will be awesome! You’re gonna learn: • What are
microformats • Benefits of microformats • How to enrich your content with some common microformats • Where you can see microformats in action • Lots of resources to help you publish microformats -
But wait! There’s more! You’ll also learn about: • Semantic
markup! • Machines! • HTML5 microdata! • ARIA Landmark Roles! -
But wait! There’s more! You’ll also learn about: • Semantic
markup! • Machines! • HTML5 microdata! • ARIA Landmark Roles! SEMANTIC FREAK -
Freelance Web Designer http://emilylewisdesign.com Author, Microformats Made Simple http://microformatsmadesimple.com Email:
[email protected] Blog: http://ablognotlimited.com Twitter: @emilylewis -
<3 at first sight Web standards • Guidelines and best
practices • More efficient • Great for team-based development • Structured content • Semantic markup MIX Online: Web Standards: Where the ROI Is -
<3 at first sight Web standards • Guidelines and best
practices • More efficient • Great for team-based development • Structured content • Semantic markup GATEWAY DRUG MIX Online: Web Standards: Where the ROI Is -
Just say yes! Now, I’m hooked on • Plain Old
Semantic Markup (POSH) -
Just say yes! Now, I’m hooked on • Plain Old
Semantic Markup (POSH) • Semantic CSS -
Just say yes! Now, I’m hooked on • Plain Old
Semantic Markup (POSH) • Semantic CSS • Microformats -
Just say yes! Now, I’m hooked on • Plain Old
Semantic Markup (POSH) • Semantic CSS • Microformats • HTML5’s new structural elements -
Just say yes! Now, I’m hooked on • Plain Old
Semantic Markup (POSH) • Semantic CSS • Microformats • HTML5’s new structural elements • ARIA roles -
Designed for humans first and machines second, microformats are a
set of simple, open data formats built upon existing and widely adopted standards. Microformats Wiki: What Are Microformats -
Designed for humans first and machines second, microformats are a
set of simple, open data formats built upon existing and widely adopted standards. Microformats enable the publishing and sharing of higher fidelity information on the web. Microformats Wiki: What Are Microformats -
Building blocks that enable users to own, control, move and
share their data on the web. Smart content Microformats Wiki: What Are Microformats -
Building blocks that enable users to own, control, move and
share their data on the web. Smart content Markup, with more meaning Microformats Wiki: What Are Microformats -
Microformats are sets of HTML attributes and values that are
applied to common web content to describe that content and give it more meaning. -
Formal microformats • hCalendar: event information • hCard: contact information
• rel-license: license links • rel-nofollow: restricting increased page rank for links • rel-tag: tag links • VoteLinks: for, against and abstain links • XFN: distributed social networks -
And even more drafts • hAtom: syndicated content • hAudio:
audio content • hListing: open, distributed listings • hMedia: video, images and audio media • hNews: journalistic news • hProduct: consumer products • hRecipe: food and beverage recipes • hResume: Résumés and C.V.s • hReview: reviews • xFolk: bookmarks -
Formal vs. Draft Formal microformats are those that are stable
and unlikely to change. Draft microformats are relatively far along in the specification process, but haven’t been formally completed. They are subject to change. -
The Basics Use existing standards • vCard: hCard • iCalendar:
hCalendar • Atom: hAtom • Other microformats and naming principles • rel • class • rev • (X)HTML -
The Basics Use existing standards • vCard: hCard • iCalendar:
hCalendar • Atom: hAtom • Other microformats and naming principles • rel • class • rev • HTML5 -
The Basics It’s all about semantics • Core purpose is
to add meaning • Publish with POSH -
So icky Not POSH <table> <tr> <td><a href="/">Home</a></td> <td><a href="/products/">Products</a></td>
<td><a href="/services/">Services</a></td> <td><a href="/about/">About</a></td> </tr> </table> <div> <p><a href="/">Home</a></p> <p><a href="/products/">Products</a></p> <p><a href="/services/">Services</a></p> <p><a href="/about/">About</a></p> </div> Also not POSH -
So pretty POSH <ul id="nav"> <li><a href="/">Home</a></li> <li><a href="/products/">Products</a></li> <li><a
href="/services/">Services</a></li> <li><a href="/about/">About</a></li> </ul> -
The Basics Address a specific “problem” • Common, real-world web
content • People • Organizations • Events • Blog posts • Reviews • Tags -
The Basics Intentionally simple • Easy to learn and use
• Based on current human behavior on the web • Aimed at 80% of use-cases; the most common -
The Basics Humans 1st, machines 2nd • Human-readable content •
From a user’s perspective, web content published with microformats is indistinguishable from that published without. • “Invisible” metadata for machine readability -
Machines! • Search engines • Browsers • Assistive technologies •
User agents • Applications -
Machine Readability The Benefits Humans Understand Please join us on
Sunday, February 20 for the In Control welcome happy hour at the Embassy Suites bar. -
Machine Readability The Benefits Humans Understand Please join us on
Sunday, February 20 for the In Control welcome happy hour at the Embassy Suites bar. Machines Don’t Blahblah blahbliby blah blahblahblibity blah blah blahblah blahblahblibity blah -
Machine Readability The Benefits • Content published with microformats is
parsable. It can be extracted and indexed, downloaded, searched for, saved, cross- referenced and combined. • Web site becomes an API, enabling sharing and re-use of content. -
Enhanced user experience The Benefits • Download to address book
• Download to calendar • More meaningful search results • Findability -
Minimal investment The Benefits • Easy to learn • Easy
to implement • No need for special software • No need to learn new technologies -
Encourages standards The Benefits • Web standards • Valid, semantic
markup • Workflows and processes for development teams • Consistent markup • Standard naming conventions for styling -
6,137,400,000+ Peer pressure • XFN: Twitter Flickr Huffduffer Digg LinkedIn
Plaxo Technorati Last.fm Google Social Graph API Ident Engine • rel-license: Creative Commons Yahoo! CC Search Google "Usage Rights" search • hCard: Google Rich Snippets 37Signals Google Maps Yahoo! Local Google Profiles Twitter Last.fm MySpace • hCalendar: Yahoo! Upcoming MapQuest Local Facebook Last.fm Eventful -
6,137,400,000+ Peer pressure • hResume: LinkedIn SimplyHired Stack Overflow •
hReview: Google Rich Snippets Yelp Yahoo! Local Technorati New York Times Travel Cork’d • hListing: Every Car Listed RealEstate.com dealtagger • hRecipe: Food Network Williams Sonoma Recipes Microformats Wiki: Examples in the Wild -
Elemental microformats • Single attribute-value pair • Often used as
building blocks for other microformats -
rel-tag Elementals <a href="/tags/css/" rel="tag">css</a> Describes the relationship of links
containing tags (keywords) to your content: The rel="tag" attribute-value pair indicates the link destination (href) is to a page that tells what the current page - or part of the current page - is about. -
What can you do with rel-tag? Elementals • Context-specific search
• Technorati's Tags • Operator Add-on for Firefox -
rel-me Elementals <a href="http://ablognotlimited.com" rel="me"> A Blog Not Limited</a> Assigned
to links to sites that represent you online: -
What can you do with rel-me? Elementals • Identity consolidation
• Ident Engine • Huffduffer -
XFN Elementals XFN is used to describe social relationships among
people me is just one of the values for the XFN microformat -
XFN Elementals Relationship XFN rel Values Friendship (one value) contact
acquaintance friend Professional (one or both values) colleague co-worker Family (one value) kin spouse child parent sibling Romantic (any or all values) muse crush date sweetheart Physical met Geographic (one value) neighbor co-resident Identity me -
XFN Elementals For links to other people’s identities online, you
can apply XFN to indicate your social relationship with that person: <a href="http://www.christopherschmitt.com/" rel="met friend colleague muse"> Christopher Schmitt</a> -
Compound microformats • Several attribute-value pairs (properties and sub-properties) •
Utilize other microformats as building blocks -
hCard Compounds Adds semantics to contact information for people, places
and organizations/companies. Contact information published with hCard can be transformed into an electronic business card. • H2VX Contacts Conversion Service • Operator Add-on for Firefox • Tails Export Add-on for Firefox • Oomph Microformats Toolkit • Michromeformats extension for Chrome -
hCard in 3 easy steps Compounds 1. Identify content 2.
POSHify 3. Add hCard -
1 STEP Emily Lewis Emily Lewis Design, LLC Albuquerque, NM
87106 [email protected] Start with Content -
2 STEP POSHify <dl> <dt>Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com">Emily Lewis Design,
LLC</a></dd> <dd>Albuquerque, <abbr title="New Mexico">NM</ abbr> 87106</dd> <dd><a href="mailto:[email protected]"> [email protected]</a></dd> </dl> -
3 STEP Add the root vcard to the element containing
all of the contact information. Then, add the relevant hCard properties and sub-properties via the class attribute Web Content hCard class Values Name (first and last) fn Web site url Address adr City locality State region ZIP postal-code Email email Add hCard -
3 STEP <dl class="vcard"> <dt>Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com">Emily Lewis Design,
LLC</a></dd> <dd>Albuquerque, <abbr title="New Mexico">NM</ abbr> 87106</dd> <dd><a href="mailto:[email protected]"> [email protected]</a></dd> </dl> Add hCard -
3 STEP <dl class="vcard"> <dt class="fn">Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com">Emily Lewis
Design, LLC</a></dd> <dd>Albuquerque, <abbr title="New Mexico">NM</ abbr> 87106</dd> <dd><a href="mailto:[email protected]"> [email protected]</a></dd> </dl> Add hCard -
3 STEP <dl class="vcard"> <dt class="fn">Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com" class="url">Emily
Lewis Design, LLC</a></dd> <dd>Albuquerque, <abbr title="New Mexico">NM</ abbr> 87106</dd> <dd><a href="mailto:[email protected]"> [email protected]</a></dd> </dl> Add hCard -
3 STEP <dl class="vcard"> <dt class="fn">Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com" class="url">Emily
Lewis Design, LLC</a></dd> <dd class="adr">Albuquerque, <abbr title="New Mexico">NM</abbr> 87106</dd> <dd><a href="mailto:[email protected]"> [email protected]</a></dd> </dl> Add hCard -
3 STEP <dl class="vcard"> <dt class="fn">Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com" class="url">Emily
Lewis Design, LLC</a></dd> <dd class="adr"><span class="locality">Albuquerque</span>, <abbr title="New Mexico">NM</abbr> 87106</dd> <dd><a href="mailto:[email protected]"> [email protected]</a></dd> </dl> Add hCard -
3 STEP <dl class="vcard"> <dt class="fn">Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com" class="url">Emily
Lewis Design, LLC</a></dd> <dd class="adr"><span class="locality">Albuquerque</span>, <abbr title="New Mexico" class="region">NM</abbr> 87106</dd> <dd><a href="mailto:[email protected]"> [email protected]</a></dd> </dl> Add hCard -
3 STEP <dl class="vcard"> <dt class="fn">Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com" class="url">Emily
Lewis Design, LLC</a></dd> <dd class="adr"><span class="locality">Albuquerque</span>, <abbr title="New Mexico" class="region">NM</abbr> <span class="postal- code">87106</span></dd> <dd><a href="mailto:[email protected]"> [email protected]</a></dd> </dl> Add hCard -
3 STEP <dl class="vcard"> <dt class="fn">Emily Lewis</dt> <dd><a href="http://emilylewisdesign.com" class="url">Emily
Lewis Design, LLC</a></dd> <dd class="adr"><span class="locality">Albuquerque</span>, <abbr title="New Mexico" class="region">NM</abbr> <span class="postal- code">87106</span></dd> <dd><a href="mailto:[email protected]" class="email">[email protected]</a></dd> </dl> Add hCard -
Non-semantic elements A Closer Look <dd class="adr"> <span class="locality">Albuquerque</span>, <abbr
title="New Mexico" class="region">NM</abbr> <span class="postal-code">87106</span> </dd> -
Don’t forget validation! A Closer Look • W3C Markup Validation
Service • Optimus Microformats Transformer -
Also worth noting • Markup doesn't matter, but it should
be POSH • Attribute values are case-sensitive • Root properties cannot be combined with sub-properties • You don't need additional class values for styling, but you can use them -
hCalendar Compounds Adds semantics to event information. Event information published
with hCalendar can be extracted and imported into users' calendars • H2VX Events Conversion Service • Operator Add-on for Firefox • Tails Export Add-on for Firefox • Oomph Microformats Toolkit • Michromeformats extension for Chrome -
hCalendar in 3 easy steps Compounds 1. Identify content 2.
POSHify 3. Add hCalendar -
1 STEP SXSWi 2011 A 5-day conference celebrating the creativity
and passion behind the coolest new media technologies • March 11-15, 2011 • Austin Convention Center Start with Content -
2 STEP POSHify <h1><a href="http://sxsw.com/interactive">SXSWi 2011</a></h1> <p>A 5-day conference celebrating
the creativity and passion behind the coolest new media technologies.</p> <ul> <li>March 11-15, 2011</li> <li>Austin Convention Center</li> </ul> -
3 STEP Add the root vevent to the element containing
all of the contact information. Then, add the relevant hCalendar properties and sub-properties via the class attribute Web Content hCalendar class Values Event name summary Web site url Description description Type of event category Start date dtstart End date dtend Location location Add hCalendar -
<div class="vevent"> <h1><a href="http://sxsw.com/interactive">SXSWi 2011</a></h1> <p>A 5-day conference celebrating the
creativity and passion behind the coolest new media technologies.</p> <ul> <li>March 11-15, 2011</li> <li>Austin Convention Center</li> </ul> </div> Add hCalendar 3 STEP -
<div class="vevent"> <h1 class="summary"><a href="http://sxsw.com/ interactive">SXSWi 2011</a></h1> <p>A 5-day conference
celebrating the creativity and passion behind the coolest new media technologies.</p> <ul> <li>March 11-15, 2011</li> <li>Austin Convention Center</li> </ul> </div> 3 STEP Add hCalendar -
<div class="vevent"> <h1 class="summary"><a href="http://sxsw.com/ interactive" class="url">SXSWi 2011</a></h1> <p>A 5-day
conference celebrating the creativity and passion behind the coolest new media technologies.</p> <ul> <li>March 11-15, 2011</li> <li>Austin Convention Center</li> </ul> </div> 3 STEP Add hCalendar -
<div class="vevent"> <h1 class="summary"><a href="http://sxsw.com/ interactive" class="url">SXSWi 2011</a></h1> <p class="description">A
5-day conference celebrating the creativity and passion behind the coolest new media technologies.</p> <ul> <li>March 11-15, 2011</li> <li>Austin Convention Center</li> </ul> </div> 3 STEP Add hCalendar -
<div class="vevent"> <h1 class="summary"><a href="http://sxsw.com/ interactive" class="url">SXSWi 2011</a></h1> <p class="description">A
5-day <span class="category">conference</span> celebrating the creativity and passion behind the coolest new media technologies.</p> <ul> <li>March 11-15, 2011</li> <li>Austin Convention Center</li> </ul> </div> 3 STEP Add hCalendar -
<div class="vevent"> <h1 class="summary"><a href="http://sxsw.com/ interactive" class="url">SXSWi 2011</a></h1> <p class="description">A
5-day <span class="category">conference</span> celebrating the creativity and passion behind the coolest new media technologies.</p> <ul> <li><span class="dtstart"><span class="value- title" title="2011-03-11"> </span>March 11</ span>-15, 2011</li> <li>Austin Convention Center</li> </ul> </div> 3 STEP Add hCalendar -
<div class="vevent"> <h1 class="summary"><a href="http://sxsw.com/ interactive" class="url">SXSWi 2011</a></h1> <p class="description">A
5-day <span class="category">conference</span> celebrating the creativity and passion behind the coolest new media technologies.</p> <ul> <li><span class="dtstart"><span class="value- title" title="2011-03-11"> </span>March 11</span>- <span class="dtend"><span class="value-title" title="2011-03-15"> </span>15, 2011</span></li> <li>Austin Convention Center</li> </ul> </div> 3 STEP Add hCalendar -
<div class="vevent"> <h1 class="summary"><a href="http://sxsw.com/ interactive" class="url">SXSWi 2011</a></h1> <p class="description">A
5-day <span class="category">conference</span> celebrating the creativity and passion behind the coolest new media technologies.</p> <ul> <li><span class="dtstart"><span class="value- title" title="2011-03-11"> </span>March 11</span>- <span class="dtend"><span class="value-title" title="2011-03-15"> </span>15, 2011</span></li> <li class="location">Austin Convention Center</li> </ul> 3 STEP Add hCalendar -
Value class pattern A Closer Look <span class="dtstart"><span class="value-title" title="2011-03-11">
</span>March 11</span> Offers authors several options for marking up date-time information: • Machine-readable date information is the title attribute value • Screen-readers won’t read the title value • No tooltip Microformats Wiki: Value Class Pattern -
hCard with rel-me Combining Microformats <dl class="vcard"> <dt class="fn">Emily Lewis</dt>
<dd><a href="http://emilylewisdesign.com" class="url" rel="me">Emily Lewis Design, LLC</a></dd> <dd class="adr"><span class="locality">Albuquerque</span>, <abbr title="New Mexico" class="region">NM</abbr> <span class="postal- code">87106</span></dd> <dd><a href="mailto:[email protected]" class="email"> [email protected]</a></dd> </dl> -
hCalendar with hCard Combining Microformats <div class="vevent"> ... <li class="location
vcard"><a href="http:// www.austinconventioncenter.com" class="fn org url">Austin Convention Center</a> <ul class="adr"> <li class="street-address">500 East Cesar Chavez Street</li> <li><span class="locality">Austin</span>, <abbr title="Texas" class="region">TX</abbr> <span class="postal-code">78701</span></li> </ul> </li> -
New structural elements HTML5 • <section> • <header> • <footer>
• <nav> • <aside> • <article> -
New structural elements HTML5 <section class="vevent"> <h1 class="summary"><a href="http://sxsw.com/ interactive"
class="url">SXSWi 2011</a></h1> ... </section> -
Microdata HTML5 <dl itemscope itemtype="http://data-vocabulary.org/ Person"> <dt itemprop="name"><a href="http:// ablognotlimited.com"
itemprop="url">Emily Lewis</a></ dt> <dd itemprop="address" itemscope itemtype="http:// data-vocabulary.org/Address"><span itemprop="locality">Albuquerque</span>, <abbr title="New Mexico" itemprop="region">NM</abbr> <span itemprop="postal-code">87106</span></dd> </dl> -
Microdata & microformats Two Stones, One Bird <dl class="vcard" itemscope
itemtype="http://data- vocabulary.org/Person"> <dt class="fn" itemprop="name"><a href="http:// ablognotlimited.com" class="url" itemprop="url">Emily Lewis</a></dt> <dd class="adr" itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address"><span class="locality" itemprop="locality">Albuquerque</ span>, <abbr title="New Mexico" class="region" itemprop="region">NM</abbr> <span class="postal-code" itemprop="postal-code">87106</span></dd> </dl> -
ARIA • Set of guidelines from WAI for accessible, rich
internet applications • Includes Document Landmark Roles to indicate document structure and aid navigation -
Document Landmark Roles • role="banner" • role="navigation" • role="main" •
role="search" • role="article" • role="complementary" • role="contentinfo" ARIA not needed on <nav> not needed on <aside> not needed on <footer> Paciello Group: Using WAI ARIA Landmark Roles -
<div id="header" role="banner"> <h1><a href="/">The Law Office of Jimbob Smith</a></h1>
<a href="/"><img src="logo.png" alt="Jimbob Legal"/></a> </div> <ul role="navigation"> <li><a href="/News/">News</a></li> <li><a href="/Services/">Services</a></li> <li><a href="/Resources/">Resources</a></li> <li><a href="/About/">About</a></li> </ul> Adding roles - XHTML ARIA -
<header role="banner"> <a href="/"> <h1>The Law Office of Jimbob Smith</h1>
<img src="logo.png" alt="Jimbob Legal" /> </a> </header> <nav> <ul> <li><a href="/News/">News</a></li> <li><a href="/Services/">Services</a></li> <li><a href="/Resources/">Resources</a></li> <li><a href="/About/">About</a></li> </ul> </nav> Adding roles - HTML5 ARIA -
• All resources and demo links from this deck •
Authoring tools • Further reading One stop shop Resources http://bit.ly/fj0BPW http://microformatsmadesimple.com/resources.php