Contributing Code Examples
From OpenSocial
Each page in the API Reference has a section for examples. Just add your code snippet and a description of what it does. Please keep your samples short and to the point so they're easy to understand.
Finding pages that need examples
If you want to help out but don't know where to start, the following pages don't have any examples at all. Why not contribute some?
- Gadgets (v0.9)
- Gadgets.MiniMessage (v0.9)
- Gadgets.Prefs (v0.9)
- Gadgets.Tab (v0.9)
- Gadgets.TabSet (v0.9)
- Gadgets.flash (v0.9)
- Gadgets.i18n (v0.9)
- Gadgets.json (v0.9)
- Gadgets.oauth.Popup (v0.9)
- Gadgets.pubsub (v0.8)
- Gadgets.rpc (v0.8)
- Gadgets.rpc (v0.9)
- Gadgets.skins (v0.8)
- Gadgets.skins (v0.9)
- Gadgets.util (v0.9)
- Gadgets.views (v0.9)
- Gadgets.window (v0.8)
- Gadgets.window (v0.9)
- Opensocial (v0.9)
- Opensocial.Activity (v0.9)
- Opensocial.Address (v0.8)
- Opensocial.Address (v0.9)
- Opensocial.BodyType (v0.8)
- Opensocial.BodyType (v0.9)
- Opensocial.Collection (v0.9)
- Opensocial.CreateActivityPriority (v0.8)
- Opensocial.CreateActivityPriority (v0.9)
- Opensocial.DataResponse (v0.9)
- Opensocial.Email (v0.8)
- Opensocial.Email (v0.9)
- Opensocial.Enum (v0.8)
- Opensocial.Enum (v0.9)
- Opensocial.Environment (v0.9)
- Opensocial.EscapeType (v0.8)
- Opensocial.EscapeType (v0.9)
- Opensocial.IdSpec (v0.9)
- Opensocial.MediaItem (v0.8)
- Opensocial.MediaItem (v0.9)
- Opensocial.Message (v0.9)
- Opensocial.MessageCollection (v0.9)
- Opensocial.Name (v0.8)
- Opensocial.Name (v0.9)
- Opensocial.NavigationParameters (v0.8)
- Opensocial.NavigationParameters (v0.9)
- Opensocial.Organization (v0.8)
- Opensocial.Organization (v0.9)
- Opensocial.Permission (v0.8)
- Opensocial.Permission (v0.9)
- Opensocial.Person (v0.8)
- Opensocial.Person (v0.9)
- Opensocial.Phone (v0.8)
- Opensocial.Phone (v0.9)
- Opensocial.ResponseItem (v0.8)
- Opensocial.ResponseItem (v0.9)
- Opensocial.Url (v0.8)
- Opensocial.Url (v0.9)
- Osapi.BatchRequest (v0.9)
- Osapi.Request (v0.9)
- Osapi.activities (v0.9)
- Osapi.appdata (v0.9)
- Osapi.http (v0.9)
- Osapi.messages (v0.9)
- Osapi.people (v0.9)
These pages have code samples which may not be comprehensive or clear enough. How about cleaning up some of them?
- Gadgets.MiniMessage (v0.8)
- Gadgets.Prefs (v0.8)
- Gadgets.Tab (v0.8)
- Gadgets.TabSet (v0.8)
- Gadgets.flash (v0.8)
- Gadgets.io (v0.8)
- Gadgets.util (v0.8)
- Gadgets.views (v0.8)
- Opensocial (v0.8)
- Opensocial.Activity (v0.8)
- Opensocial.Collection (v0.8)
- Opensocial.DataRequest (v0.8)
- Opensocial.DataRequest (v0.9)
- Opensocial.IdSpec (v0.8)
Syntax highlighting
You can have the wiki perform syntax highlighting for your code sample by using the <source lang="foo"> tag. For example, the following code:
<source lang="javascript">
function helloWorld()
{
return "Hi";
}
</source>
will render as:
function helloWorld() { return "Hi"; }
You can use "java", "javascript", "php", "python", "xml" and more as the value for the "lang" attribute. See the full list here.
