Activity microformat: Difference between revisions

From OLPC
Jump to navigation Jump to search
(more documentation, use of this on the wiki)
(#REDIRECT User:Walter)
Line 1: Line 1:
#REDIRECT [[User:Walter]]
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 <code>pydoc bitfrost.update.microformat</code> on an XO.
----
== Overview ==
Activity information is embedded in HTML/XHTML/XML pages using a
semantic [http://microformats.org/ microformat].
Utilities such as [[Software update]] in the [[Sugar Control Panel]] can parse this information to determine that a newer activity version is available and download it.

== CSS for microformat ==
The following
CSS rules pull out the desired information.

Repository/group information for related activities is denoted by the
[http://www.w3.org/Style/CSS/ 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. These attributes are optional, and are not expected to be included
in pages describing updates for an individual activity.

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:

<pre><nowiki>
.olpc-activity-info .olpc-activity-url *[href]
</nowiki></pre>

An example:

<pre><nowiki>
<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>
</nowiki></pre>

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

== Activity microformat on this wiki ==
[[Software updater]] consults [[activity group]] pages on this wiki, such as [[Activities/G1G1]] and [[Activities/G1G1/8.2]] and reads the activity microformat information in them to determine if newer versions of activities are available.

Activity maintainers should use the template <tt>{{tl|Activity-oneline}}</tt> to provide information for these activity group pages.
This template presents information about your activity using the correct CSS for this microformat.
You can either embed the template directly in an activity group page, or put the information in a fragment such as [[Activities/Browse (latest)]] and transclude this on activity group pages using

Other templates such as {{tl|Project-summary}} also generate the correct CSS for this microformat.

[[Category:Activity installation]]

Revision as of 18:03, 26 November 2009

Redirect to: