Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): versioned docs #220

Merged
merged 2 commits into from
Sep 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 120 additions & 88 deletions docs/components/docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ <h1 class="logo">

<article class="main lang-page" role="main">
<header class="docs-header">
<h1 class="page-title">Node.js</h1>
<h1 class="page-title">{{pageTitle}}</h1>

<div class="versions" ng-show="showReference">
<span class="v-current">{{version}} <i ng-if="isLatestVersion">(Latest version)</i></span>
<a href="#/docs/history" class="v-btn">
<img src="img/icon-arrow-bullet.svg" />
See version History
</a>
</div><!-- end of .versions -->
</header>

<section class="content">
<article ng-show="showReference">
<h1>{{module[0].toUpperCase() + module.substr(1)}}</h1>
<h3 class="sub-heading">
<div class="toggler" ng-click="showGcloudDocs = !showGcloudDocs">
Expand All @@ -21,107 +30,130 @@ <h3 class="sub-heading">
</div>
Getting Started with <code>gcloud</code>
</h3>
<article ng-if="showGcloudDocs">
<p>
First, install <code>gcloud</code> with npm and require it into your project:
</p>
<div hljs>$ npm install --save gcloud</div>
<div hljs>var gcloud = require('gcloud');</div>
<p>
There are a couple of ways to use the <code>gcloud</code> module.
</p>
<p>
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 <code>gcloud</code>&mdash; we figure that out for you.
</p>
<p>
However, if you're running your app elsewhere, you will need to provide this information.
</p>
<div hljs>
// App Engine and Compute Engine
var gcloud = require('gcloud');
<article ng-if="showGcloudDocs">
<h1>{{module[0].toUpperCase() + module.substr(1)}}</h1>
<p>
First, install <code>gcloud</code> with npm and require it into your project:
</p>
<div hljs>$ npm install --save gcloud</div>
<div hljs>var gcloud = require('gcloud');</div>
<p>
There are a couple of ways to use the <code>gcloud</code> module.
</p>
<p>
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 <code>gcloud</code>&mdash; we figure that out for you.
</p>
<p>
However, if you're running your app elsewhere, you will need to provide this information.
</p>
<div hljs>
// App Engine and Compute Engine
var gcloud = require('gcloud');

// Elsewhere
var gcloud = require('gcloud')({
keyFilename: '/path/to/keyfile.json'
});</div>
<p>
In any environment, you are free to provide these and other default properties, which eventually will be passed to the <code>gcloud</code> sub-modules (Datastore, Storage, etc.).
</p>
</article>
<hr>
<article ng-if="isActiveDoc('datastore')">
<h2>Overview</h2>
<p>
The <code>gcloud.datastore</code> object gives you some convenience methods, as well as exposes a <code>dataset</code> function. This will allow you to create a <code>dataset</code>, which is the object from which you will interact with the Google Cloud Datastore.
</p>
<div hljs>
var datastore = gcloud.datastore;
var dataset = datastore.dataset({
projectId: 'myProject',
keyFilename: '/path/to/keyfile.json'
});</div>
<p ng-if="!isActiveUrl('/docs/datastore/dataset')">
See <a href="#/docs/datastore/dataset">the Dataset documentation</a> for examples of how to query the datastore, save entities, run a transaction, and others.
</p>
</article>
<article ng-if="isActiveDoc('storage')">
<h2>Overview</h2>
<p>
The <code>gcloud.storage</code> object contains a <code>bucket</code> object, which is how you will interact with your Google Cloud Storage bucket. See the guide on <a href="https://developers.google.com/storage">Google Cloud Storage</a> to create a bucket.
</p>
<p>
See examples below for more on how to access your bucket to upload a file, read its files, create signed URLs, and more.
</p>
</article>
// Elsewhere
var gcloud = require('gcloud')({
keyFilename: '/path/to/keyfile.json'
});</div>
<p>
In any environment, you are free to provide these and other default properties, which eventually will be passed to the <code>gcloud</code> sub-modules (Datastore, Storage, etc.).
</p>
</article>
<hr>
<article ng-if="isActiveDoc('datastore')">
<h2>Overview</h2>
<p>
The <code>gcloud.datastore</code> object gives you some convenience methods, as well as exposes a <code>dataset</code> function. This will allow you to create a <code>dataset</code>, which is the object from which you will interact with the Google Cloud Datastore.
</p>
<div hljs>
var datastore = gcloud.datastore;
var dataset = datastore.dataset({
projectId: 'myProject',
keyFilename: '/path/to/keyfile.json'
</div>
<p ng-if="!isActiveUrl('/docs/datastore/dataset')">
See <a href="#/docs/{{version}}/datastore/dataset">the Dataset documentation</a> for examples of how to query the datastore, save entities, run a transaction, and others.
</p>
</article>

<article
ng-repeat="method in methods"
ng-hide="singleMethod && method.name !== singleMethod">
<h2 ng-if="method.name[0].toUpperCase() === method.name[0]">
{{method.name}}
</h2>
<h3
class="method-heading"
ng-if="method.name[0].toUpperCase() !== method.name[0]">
<a
class="permalink"
ng-if="!noPermalink"
ng-href="{{activeUrl + '/' + method.name}}">#</a>
{{method.name}}
</h3>
<p ng-if="method.description" ng-bind-html="method.description"></p>
<h4 ng-show="method.params">Parameters</h4>
<table class="table" ng-show="method.params">
<tbody>
<tr ng-repeat="param in method.params">
<th scope="row">{{param.name}}</th>
<td ng-bind-html="param.types"></td>
<td ng-bind-html="param.description"></td>
</tr>
</tbody>
</table>
<h4 ng-show="method.returns">Returns</h4>
<p ng-show="method.returns" ng-bind-html="method.returns"></p>
<h4 ng-show="method.example">Example</h4>
<div ng-repeat-end
ng-show="method.example"
hljs source="method.example" language="js"></div>
<hr ng-if="$index < methods.length - 1">
<article ng-if="isActiveDoc('storage')">
<p>
The <code>gcloud.storage</code> object contains a <code>Bucket</code> object, which is how you will interact with your Google Cloud Storage bucket.
</p>
<div hljs>
var storage = gcloud.storage;
var bucket = new storage.Bucket({
bucketName: 'MyBucket'
});</div>
<p ng-if="!isActiveUrl('/docs/datastore/dataset')">
See <a href="#/docs/datastore/dataset">the Dataset documentation</a> for examples of how to query the datastore, save entities, run a transaction, and others.
</p>
</article>
<article ng-if="isActiveDoc('storage')">
<h2>Overview</h2>
<p>
The <code>gcloud.storage</code> object contains a <code>bucket</code> object, which is how you will interact with your Google Cloud Storage bucket. See the guide on <a href="https://developers.google.com/storage">Google Cloud Storage</a> to create a bucket.
</p>
<p>
See examples below for more on how to access your bucket to upload a file, read its files, create signed URLs, and more.
</p>
</article>

<article
ng-repeat="method in methods"
ng-hide="singleMethod && method.name !== singleMethod">
<h2 ng-if="method.name[0].toUpperCase() === method.name[0]">
{{method.name}}
</h2>
<h3
class="method-heading"
ng-if="method.name[0].toUpperCase() !== method.name[0]">
<a
class="permalink"
ng-if="!noPermalink"
ng-href="{{activeUrl + '/' + method.name}}">#</a>
{{method.name}}
</h3>
<p ng-if="method.description" ng-bind-html="method.description"></p>
<h4 ng-show="method.params">Parameters</h4>
<table class="table" ng-show="method.params">
<tbody>
<tr ng-repeat="param in method.params">
<th scope="row">{{param.name}}</th>
<td ng-bind-html="param.types"></td>
<td ng-bind-html="param.description"></td>
</tr>
</tbody>
</table>
<h4 ng-show="method.returns">Returns</h4>
<p ng-show="method.returns" ng-bind-html="method.returns"></p>
<h4 ng-show="method.example">Example</h4>
<div ng-repeat-end
ng-show="method.example"
hljs source="method.example" language="js"></div>
<hr ng-if="$index < methods.length - 1">
</article>
</article>
<article ng-show="showHistory">
<ul class="v-list">
<li ng-repeat="version in versions">
<a ng-href="#/docs/{{version}}">{{version}}</a>
</li>
</ul>
</article>
</section><!-- end of .content -->

<nav class="side-nav">
<ul class="page-sections">
<ul class="page-sections" ng-show="showReference">
<li ng-repeat="page in pages">
<a
ng-class="{ current: isActiveUrl(page.url) }"
ng-class="{ current: docs.isActiveUrl(page.url) }"
ng-href="{{page.url}}">
{{page.title}}
</a>
<ul class="sub-sections" ng-if="page.pages">
<li ng-repeat="innerPage in page.pages">
<a
ng-class="{ current: isActiveUrl(page.url + innerPage.url) }"
ng-class="{ current: docs.isActiveUrl(page.url + innerPage.url) }"
ng-href="{{page.url + innerPage.url}}">
{{innerPage.title}}
</a>
Expand Down
Loading