Activity microformat: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Imported content from the pydoc.)
 
(Link to another example of an activity information page.)
Line 57: Line 57:
</table>
</table>
</nowiki></pre>
</nowiki></pre>

Another example can be found at: http://dev.laptop.org/~cscott/bundles/firefox.html

Revision as of 17:45, 9 August 2008

The definitive source for this document is the documentation for the 'bitfrost.update.microformat' package, which can be found at http://dev.laptop.org/git?p=users/cscott/sugar-update-control;a=blob;f=bitfrost/update/microformat.py and by running pydoc bitfrost.update.microformat on an XO.


Activity information is embedded in HTML/XHTML/XML pages using a semantic microformat. The following CSS rules pull out the desired information.

Repository/group information for related activities is denoted by the CSS selector:

 #olpc-activity-group-name

which provides a "short name" for the group, and:

 #olpc-activity-group-desc

which provides a slightly longer description. As indicated by the fact that these are matches on the 'id' attribute, they should match exactly once.

Each block of activity information is denoted by the selector:

 .olpc-activity-info

All information within that block describes a single available version of an activity, so the following selectors should match at most once within the block.

The activity id, which should be unique among all activities, is denoted by the contents of the element identified by the selector:

 .olpc-activity-info .olpc-activity-id

The version number is denoted by the contents of the element identified by the selector:

 .olpc-activity-info .olpc-activity-version

The version URL is denoted by the contents of the href attribute of the element identified by the selector:

  .olpc-activity-info .olpc-activity-url *[href]

An example:

  <table class="olpc-activity-info">
  <tr>
  <td>Browse</td>
  <td class="olpc-activity-id"
      style="display:none;">org.laptop.WebActivity</td>
  <td class="olpc-activity-version">54</td>
  <td class="olpc-activity-url"><a href="Browse-54.xo">download!</a></td>
  </td>
  </table>

Another example can be found at: http://dev.laptop.org/~cscott/bundles/firefox.html