diff --git a/docs/site/css/main.css b/docs/site/css/main.css index 1444b34a997..006f63238bd 100755 --- a/docs/site/css/main.css +++ b/docs/site/css/main.css @@ -586,6 +586,32 @@ ul { color: #4285f4; } +.about .code-sample-tabs { + margin-top: 10px; + width: 450px; +} + +.about .code-sample-tabs a { + display: inline-block; + padding: 2px 12px 0px 12px; + border: 1px solid rgba(0,0,0,0.2); + background-color: #fefefe; + margin-bottom: -3px; + margin-right: 8px; + color: #333; + text-decoration: none; +} + +.about .code-sample-tabs a.selected { + background-color: #f8f8f8; + font-weight: bold; + border-bottom-color: #f8f8f8; +} + +.about pre { + margin-top: 0; +} + /* Examples */ diff --git a/docs/site/home.html b/docs/site/home.html index 5399f483aa3..79d059e8d28 100755 --- a/docs/site/home.html +++ b/docs/site/home.html @@ -80,9 +80,28 @@

What is it?

-

Retrieve Datastore Entities

+

Example: Retrieve an entity from Cloud Datastore

+ +
+ Run in Compute Engine + Run elsewhere +
+ +
+// Auth is handled automatically inside GCE. +var gcloud = require('gcloud'); +var dataset = gcloud.datastore.dataset(); +var productKey = dataset.key(['Product', 123]); + +dataset.get(productKey, function(err, entity) { + console.log(err, entity); +});
-
+
var gcloud = require('gcloud')({ projectId: 'my-project', keyFilename: '/path/to/keyfile.json'