From 29b6b0d4888f34ce31029a1fafee6042d0d73905 Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Tue, 16 Dec 2014 12:22:36 -0500 Subject: [PATCH 1/2] docs: nest site into new directory --- docs/components/docs/docs.html | 209 ------------------ docs/faq.md | 29 +++ docs/index.html | 25 ++- .../components/docs/docs-directives.js | 0 .../components/docs/docs-services.js | 0 .../{ => site}/components/docs/docs-values.js | 0 docs/site/components/docs/docs.html | 153 +++++++++++++ docs/{ => site}/components/docs/docs.js | 14 +- docs/site/components/faq/faq.html | 16 ++ docs/site/components/faq/faq.js | 15 ++ .../components/header/header-directive.js | 14 ++ docs/site/components/header/header.html | 4 + .../components/subpage/subpage-directive.js | 23 ++ docs/site/components/subpage/subpage.html | 81 +++++++ .../troubleshooting/troubleshooting.html | 16 ++ .../troubleshooting/troubleshooting.js | 15 ++ docs/{ => site}/css/main.css | 7 + docs/{ => site}/css/normalize.css | 0 docs/{ => site}/home.html | 12 +- docs/{ => site}/home.js | 20 +- docs/{ => site}/img/.gitignore | 0 docs/{ => site}/img/icon-arrow-bullet.svg | 0 docs/{ => site}/img/icon-dropdown-faq.svg | 0 docs/{ => site}/img/icon-dropdown.svg | 0 docs/{ => site}/img/icon-lang-nodejs.svg | 0 docs/{ => site}/img/icon-lang-python.svg | 0 docs/{ => site}/img/icon-lang-ruby.svg | 0 docs/{ => site}/img/icon-link-github.svg | 0 .../img/icon-link-package-manager.svg | 0 .../img/icon-link-stackoverflow.svg | 0 docs/{ => site}/img/icon-menu.svg | 0 docs/{ => site}/img/icon-table-check.svg | 0 docs/{ => site}/img/lang-bg.png | Bin docs/{ => site}/img/logo-full.svg | 0 docs/{ => site}/img/logo.svg | 0 .../angular-markdown-directive/markdown.js | 36 +++ docs/{ => site}/lib/node-semver/LICENSE | 0 .../lib/node-semver/semver.browser.js | 0 docs/troubleshooting.md | 1 + 39 files changed, 454 insertions(+), 236 deletions(-) delete mode 100644 docs/components/docs/docs.html create mode 100644 docs/faq.md rename docs/{ => site}/components/docs/docs-directives.js (100%) rename docs/{ => site}/components/docs/docs-services.js (100%) rename docs/{ => site}/components/docs/docs-values.js (100%) create mode 100644 docs/site/components/docs/docs.html rename docs/{ => site}/components/docs/docs.js (96%) create mode 100644 docs/site/components/faq/faq.html create mode 100644 docs/site/components/faq/faq.js create mode 100644 docs/site/components/header/header-directive.js create mode 100644 docs/site/components/header/header.html create mode 100644 docs/site/components/subpage/subpage-directive.js create mode 100644 docs/site/components/subpage/subpage.html create mode 100644 docs/site/components/troubleshooting/troubleshooting.html create mode 100644 docs/site/components/troubleshooting/troubleshooting.js rename docs/{ => site}/css/main.css (99%) rename docs/{ => site}/css/normalize.css (100%) rename docs/{ => site}/home.html (91%) rename docs/{ => site}/home.js (67%) rename docs/{ => site}/img/.gitignore (100%) rename docs/{ => site}/img/icon-arrow-bullet.svg (100%) rename docs/{ => site}/img/icon-dropdown-faq.svg (100%) rename docs/{ => site}/img/icon-dropdown.svg (100%) rename docs/{ => site}/img/icon-lang-nodejs.svg (100%) rename docs/{ => site}/img/icon-lang-python.svg (100%) rename docs/{ => site}/img/icon-lang-ruby.svg (100%) rename docs/{ => site}/img/icon-link-github.svg (100%) rename docs/{ => site}/img/icon-link-package-manager.svg (100%) rename docs/{ => site}/img/icon-link-stackoverflow.svg (100%) rename docs/{ => site}/img/icon-menu.svg (100%) rename docs/{ => site}/img/icon-table-check.svg (100%) rename docs/{ => site}/img/lang-bg.png (100%) rename docs/{ => site}/img/logo-full.svg (100%) rename docs/{ => site}/img/logo.svg (100%) create mode 100644 docs/site/lib/angular-markdown-directive/markdown.js rename docs/{ => site}/lib/node-semver/LICENSE (100%) rename docs/{ => site}/lib/node-semver/semver.browser.js (100%) create mode 100644 docs/troubleshooting.md diff --git a/docs/components/docs/docs.html b/docs/components/docs/docs.html deleted file mode 100644 index 1ab9f8ade1b..00000000000 --- a/docs/components/docs/docs.html +++ /dev/null @@ -1,209 +0,0 @@ - - -
-
-

{{pageTitle}}

- -
- {{version}} (Latest version) - - - See version History - -
-
- -
-
-

-
- - -
- Getting Started with gcloud -

-
-

- First, install gcloud with npm and require it into your project: -

-
$ npm install --save gcloud
-
var gcloud = require('gcloud');
-

- There are a couple of ways to use the gcloud module. -

-

- If you are running your app on Google App Engine or Google Compute Engine, you won't need to worry about supplying connection configuration options to gcloud— we figure that out for you. -

-

- However, if you're running your app elsewhere, you will need to provide this information. -

-
-// App Engine and Compute Engine -var gcloud = require('gcloud'); - -// Elsewhere -var gcloud = require('gcloud')({ - keyFilename: '/path/to/keyfile.json' -});
-

- In any environment, you are free to provide these and other default properties, which eventually will be passed to the gcloud sub-modules (Datastore, Storage, etc.). -

-
-
- -
-

BigQuery Overview

-

- The object returned from gcloud.bigquery gives you complete access to and control of your BigQuery datasets. You can work with existing ones, by using the dataset method, or create new ones with createDataset. -

-
-var bigquery = gcloud.bigquery();
-

- Follow along with the examples below to see how to query your datasets, create tables, import data from your Cloud Storage buckets, and more. -

-
- -
-

Datastore Overview

-

- The gcloud.datastore object gives you some convenience methods, as well as exposes a dataset function. This will allow you to create a dataset, which is the object from which you will interact with the Google Cloud Datastore. -

-
-var dataset = gcloud.datastore.dataset({ - projectId: 'myProject', - keyFilename: '/path/to/keyfile.json' -});
-

- See the Dataset documentation for examples of how to query the datastore, save entities, run a transaction, and others. -

-
- -
-

Pub/Sub Overview

-

- Google Cloud Pub/Sub is in Alpha status. As a result, it might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy. -

-

- The gcloud.pubsub method will return a pubsub object, allowing you to create topics, publish messages, subscribe to topics, and more. See the Google Cloud Pub/Sub overview for more information. -

-
-var pubsub = gcloud.pubsub({ - projectId: 'myProject', - keyFilename: '/path/to/keyfile.json' -});
-

- See the examples below, which demonstrate everything from creating a topic to subscribing to messages on a topic. -

-
- -
-

Storage Overview

-

- The gcloud.storage object contains a bucket function, which is how you will interact with your Google Cloud Storage bucket. See the guide on Google Cloud Storage to create a bucket. -

-
-var bucket = gcloud.storage.bucket('my-bucket');
-

- See examples below for more on how to access your bucket to upload a file, read its files, create signed URLs, and more. -

-
- -
-

- {{method.name}} -

-

- - {{method.name}} -

-

-

Parameters

- - - - - - - - -
{{param.name}}
-

Returns

-

-

Example

-
-
-
-
- -
- - -
diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 00000000000..d7f2a32e907 --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,29 @@ +## How do I use `gcloud` with Google Compute Engine? + +If you are running this client on Google Compute Engine, we handle authorization for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +## I'm not using Compute Engine. What do I need to do? + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud Datastore API + * Google Cloud Storage + * Google Cloud Storage JSON API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authorize your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +## What is the relationship between this and the `gcloud` command-line tool? + +Both this library and the `gcloud` command-line tool are a part of the Google Cloud SDK: a collection of tools and libraries that enable you to easily create and manage resources on the Google Cloud Platform. The `gcloud` command-line tool can be used to manage both your development workflow and your Google Cloud Platform resources while this is the Google Cloud Client Library for Node.js. + +## Does this replace [Google Cloud Node.js Client][googleapis]? + +Google Cloud Node.js Client is a client library for using the broad set of Google APIs. `gcloud` is built specifically for the Google Cloud Platform and is the recommended way to integrate Google Cloud APIs into your Node.js applications. If your application requires both Google Cloud Platform and other Google APIs, the 2 libraries may be used together. + +[dev-console]: https://console.developers.google.com/project +[gce-how-to]: https://developers.google.com/compute/docs/authentication#using +[googleapis]: https://github.com/google/google-api-nodejs-client diff --git a/docs/index.html b/docs/index.html index 7cd3a5a921f..622d344eb8a 100755 --- a/docs/index.html +++ b/docs/index.html @@ -10,8 +10,8 @@ - - + + @@ -23,15 +23,22 @@
- + + - - - - - - + + + + + + + + + + + + + +
+
+

+
+ + +
+ Getting Started with gcloud +

+
+

+ First, install gcloud with npm and require it into your project: +

+
$ npm install --save gcloud
+
var gcloud = require('gcloud');
+

+ There are a couple of ways to use the gcloud module. +

+

+ If you are running your app on Google App Engine or Google Compute Engine, you won't need to worry about supplying connection configuration options to gcloud— we figure that out for you. +

+

+ However, if you're running your app elsewhere, you will need to provide this information. +

+
+// App Engine and Compute Engine +var gcloud = require('gcloud'); + +// Elsewhere +var gcloud = require('gcloud')({ +keyFilename: '/path/to/keyfile.json' +});
+

+ In any environment, you are free to provide these and other default properties, which eventually will be passed to the gcloud sub-modules (Datastore, Storage, etc.). +

+
+
+ +
+

BigQuery Overview

+

+ The object returned from gcloud.bigquery gives you complete access to and control of your BigQuery datasets. You can work with existing ones, by using the dataset method, or create new ones with createDataset. +

+
+var bigquery = gcloud.bigquery();
+

+ Follow along with the examples below to see how to query your datasets, create tables, import data from your Cloud Storage buckets, and more. +

+
+ +
+

Datastore Overview

+

+ The gcloud.datastore object gives you some convenience methods, as well as exposes a dataset function. This will allow you to create a dataset, which is the object from which you will interact with the Google Cloud Datastore. +

+
+var dataset = gcloud.datastore.dataset({ +projectId: 'myProject', +keyFilename: '/path/to/keyfile.json' +});
+

+ See the Dataset documentation for examples of how to query the datastore, save entities, run a transaction, and others. +

+
+ +
+

Pub/Sub Overview

+

+ Google Cloud Pub/Sub is in Alpha status. As a result, it might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy. +

+

+ The gcloud.pubsub method will return a pubsub object, allowing you to create topics, publish messages, subscribe to topics, and more. See the Google Cloud Pub/Sub overview for more information. +

+
+var pubsub = gcloud.pubsub({ +projectId: 'myProject', +keyFilename: '/path/to/keyfile.json' +});
+

+ See the examples below, which demonstrate everything from creating a topic to subscribing to messages on a topic. +

+
+ +
+

Storage Overview

+

+ The gcloud.storage object contains a bucket function, which is how you will interact with your Google Cloud Storage bucket. See the guide on Google Cloud Storage to create a bucket. +

+
+var bucket = gcloud.storage.bucket('my-bucket');
+

+ See examples below for more on how to access your bucket to upload a file, read its files, create signed URLs, and more. +

+
+ +
+

+ {{method.name}} +

+

+ + {{method.name}} +

+

+

Parameters

+ + + + + + + + +
{{param.name}}
+

Returns

+

+

Example

+
+
+
+
+ +
diff --git a/docs/components/docs/docs.js b/docs/site/components/docs/docs.js similarity index 96% rename from docs/components/docs/docs.js rename to docs/site/components/docs/docs.js index f179ba847cf..fdcdd84efce 100644 --- a/docs/components/docs/docs.js +++ b/docs/site/components/docs/docs.js @@ -1,5 +1,5 @@ angular - .module('gcloud.docs', ['ngRoute', 'hljs', 'config']) + .module('gcloud.docs', ['ngRoute', 'gcloud.header', 'gcloud.subpage', 'hljs', 'config']) .config(function($routeProvider, versions) { 'use strict'; @@ -264,21 +264,21 @@ angular }) .when('/docs/history', { controller: 'HistoryCtrl', - templateUrl: 'components/docs/docs.html' + templateUrl: 'site/components/docs/docs.html' }) .when('/docs/:version', { controller: 'DocsCtrl', - templateUrl: 'components/docs/docs.html', + templateUrl: 'site/components/docs/docs.html', resolve: { methods: getMethods, links: getLinks } }) .when('/docs/:version/:module', { controller: 'DocsCtrl', - templateUrl: 'components/docs/docs.html', + templateUrl: 'site/components/docs/docs.html', resolve: { methods: getMethods, links: getLinks } }) .when('/docs/:version/:module/:class', { controller: 'DocsCtrl', - templateUrl: 'components/docs/docs.html', + templateUrl: 'site/components/docs/docs.html', resolve: { methods: getMethods, links: getLinks } }); }) @@ -307,6 +307,10 @@ angular 'use strict'; $scope.isActiveUrl = function(url) { + if (url === '/docs') { + return true; + } + var active = $location.path() .replace('/' + methods.singleMethod, '') .replace('/' + $scope.version, ''); diff --git a/docs/site/components/faq/faq.html b/docs/site/components/faq/faq.html new file mode 100644 index 00000000000..4fedb55c1a3 --- /dev/null +++ b/docs/site/components/faq/faq.html @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/docs/site/components/faq/faq.js b/docs/site/components/faq/faq.js new file mode 100644 index 00000000000..1085ba3e278 --- /dev/null +++ b/docs/site/components/faq/faq.js @@ -0,0 +1,15 @@ +angular + .module('gcloud.faq', ['ngRoute', 'gcloud.subpage', 'btford.markdown']) + .config(function($routeProvider) { + 'use strict'; + + $routeProvider.when('/faq', { + controller: 'FaqCtrl', + templateUrl: 'site/components/faq/faq.html' + }); + }) + + .controller('FaqCtrl', function($scope) { + 'use strict'; + + }); diff --git a/docs/site/components/header/header-directive.js b/docs/site/components/header/header-directive.js new file mode 100644 index 00000000000..61a9bb6ca49 --- /dev/null +++ b/docs/site/components/header/header-directive.js @@ -0,0 +1,14 @@ +angular + .module('gcloud.header', []) + .directive('header', function() { + 'use strict'; + + return { + replace: true, + transclude: true, + templateUrl: 'site/components/header/header.html', + link: function($scope, elem, attrs) { + $scope.title = attrs.title; + } + }; + }); diff --git a/docs/site/components/header/header.html b/docs/site/components/header/header.html new file mode 100644 index 00000000000..56c77ad1921 --- /dev/null +++ b/docs/site/components/header/header.html @@ -0,0 +1,4 @@ +
+

{{title}}

+
+
diff --git a/docs/site/components/subpage/subpage-directive.js b/docs/site/components/subpage/subpage-directive.js new file mode 100644 index 00000000000..57edc4d4acc --- /dev/null +++ b/docs/site/components/subpage/subpage-directive.js @@ -0,0 +1,23 @@ +angular + .module('gcloud.subpage', ['gcloud.header']) + .directive('subpage', function($parse, $location) { + 'use strict'; + + return { + transclude: true, + templateUrl: 'site/components/subpage/subpage.html', + link: function($scope, elem, attrs) { + $scope.title = attrs.title; + $scope.links = $parse(attrs.links)(); + $scope.headerTemplateUrl = attrs.headerTemplateurl; + + if (attrs.isActiveUrl) { + $scope.isActiveUrl = $parse(attrs.isActiveUrl)($scope); + } else { + $scope.isActiveUrl = function (url) { + return $location.path() === url.replace('#', ''); + } + } + } + }; + }); diff --git a/docs/site/components/subpage/subpage.html b/docs/site/components/subpage/subpage.html new file mode 100644 index 00000000000..b908c58bccf --- /dev/null +++ b/docs/site/components/subpage/subpage.html @@ -0,0 +1,81 @@ +
+ + +
+
+ +
+ + +
diff --git a/docs/site/components/troubleshooting/troubleshooting.html b/docs/site/components/troubleshooting/troubleshooting.html new file mode 100644 index 00000000000..4b80d863c5d --- /dev/null +++ b/docs/site/components/troubleshooting/troubleshooting.html @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/docs/site/components/troubleshooting/troubleshooting.js b/docs/site/components/troubleshooting/troubleshooting.js new file mode 100644 index 00000000000..a2c996290f9 --- /dev/null +++ b/docs/site/components/troubleshooting/troubleshooting.js @@ -0,0 +1,15 @@ +angular + .module('gcloud.troubleshooting', ['ngRoute', 'gcloud.subpage', 'btford.markdown']) + .config(function($routeProvider) { + 'use strict'; + + $routeProvider.when('/troubleshooting', { + controller: 'TroubleshootingCtrl', + templateUrl: 'site/components/troubleshooting/troubleshooting.html' + }); + }) + + .controller('TroubleshootingCtrl', function($scope) { + 'use strict'; + + }); diff --git a/docs/css/main.css b/docs/site/css/main.css similarity index 99% rename from docs/css/main.css rename to docs/site/css/main.css index 52daf9562cf..02a9d5a4ef3 100755 --- a/docs/css/main.css +++ b/docs/site/css/main.css @@ -1107,6 +1107,13 @@ h2, h3 { top: 7em; } + /* + GitHub Edit Heade Button + */ + .header--gh-edit-btn { + top: 8em; + } + /* Content */ diff --git a/docs/css/normalize.css b/docs/site/css/normalize.css similarity index 100% rename from docs/css/normalize.css rename to docs/site/css/normalize.css diff --git a/docs/home.html b/docs/site/home.html similarity index 91% rename from docs/home.html rename to docs/site/home.html index a805c44b958..b1c3872657a 100755 --- a/docs/home.html +++ b/docs/site/home.html @@ -1,5 +1,5 @@
@@ -25,31 +25,31 @@

One-line npm install