Skip to content

Commit

Permalink
Initial update to generate json docs
Browse files Browse the repository at this point in the history
Testing deploy with 1:1 class:json.

Add overview.html

Deploy script working now in testing.

Fix code blocks.

Add href support.

Add snippets to base service module. closes googleapis#1951

Fix types generation.

Fix linking.

Fix external github links.

Update gcloud-commit site files.

Swtich to live site generation.

clean up manifest for starters.

Remove old example detection code.

Update TOC.
  • Loading branch information
daspecster committed Jul 20, 2016
1 parent 45f5189 commit de3d16f
Show file tree
Hide file tree
Showing 34 changed files with 2,606 additions and 181 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ script:
- tox -e system-tests
- tox -e system-tests3
- scripts/update_docs.sh
- scripts/update_json_docs.sh

after_success:
- tox -e coveralls
Expand Down
130 changes: 130 additions & 0 deletions docs/json/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<section class="hero-banner">
<div class="container clearfix">
<div class="quote-box">
<h1>gcloud</h1>
<p>Google Cloud Client Library for Python
- an idiomatic, intuitive, and natural way for Python developers to
integrate with Google Cloud Platform services, like Cloud Datastore
and Cloud Storage.</p>
</div>

<div class="quote-box--supplementary">
<pre class="skip-highlight"><code class="subtle--blue">$</code> npm install <code class="subtle--blue">--save</code> <strong>gcloud</strong></pre>
<h4 class="latest-release subtle" ng-if="home.latestRelease">
Latest Release <a ng-href="{{home.latestRelease.link}}" class="latest-release--link white">{{home.latestRelease.name}}</a>
{{home.latestRelease.date|date}}
</h4>
</div>
</div><!-- end of .container -->
</section><!-- end of .hero-banner -->

<section class="block featuring">
<div class="container">
<ul class="featuring-links">
<li>
<a href="#/docs/{{home.latestRelease.name}}/gcloud" title="gcloud-python docs" class="btn btn-docs">
<img src="src/images/icon-lang-python.svg" alt="Python icon" />
Read the Docs
</a>
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/gcloud-python" title="gcloud-python on GitHub" class="ext-link">
<img src="src/images/icon-link-github.svg" alt="GitHub icon" />
GitHub
</a>
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/gcloud-python/issues" title="gcloud-python issues on Github" class="ext-link">
<img src="src/images/icon-link-github.svg" alt="GitHub icon" />
Issues
</a>
</li>
<li>
<a href="http://stackoverflow.com/questions/tagged/gcloud-python" title="gcloud-python on StackOverflow" class="ext-link">
<img src="src/images/icon-link-stackoverflow.svg" alt="StackOverflow icon" />
StackOverflow
</a>
</li>
<li>
<a href="https://pypi.python.org/pypi/gcloud" title="gcloud-python on pypi" class="ext-link">
<img src="src/images/icon-link-package-manager.svg" alt="pypi icon" />
npm
</a>
</li>
</ul>
</div><!-- end of .container -->
</section><!-- end of .featuring -->

<section class="block about">
<div class="container clearfix">
<div class="quote-box">
<h3 class="block-title">What is it?</h3>

<p><code>gcloud</code> is a client library for accessing Google
Cloud Platform services that significantly reduces the boilerplate
code you have to write. The library provides high-level API
abstractions so they're easier to understand. It embraces
idioms of Python, works well with the standard library, and
integrates better with your codebase.
All this means you spend more time creating code that matters
to you.</p>

<p><code>gcloud</code> is configured to access Google Cloud Platform
services and authorize (OAuth 2.0) automatically on your behalf.
With a one-line install and a private key, you are up and ready
to go. Better yet, if you are running on a Google Compute Engine
instance, the one-line install is enough!</p>

</div>

<div class="quote-box--supplementary">
<h4>Retrieve Datastore Entities</h4>

<div hljs hlsj-language="python">
from gcloud import datastore

client = datastore.Client()
product_key = client.key('Product', 123)
print(client.get(product_key))
</div>
</div>
</div><!-- end of .container -->
</section><!-- end of .featuring -->

<section class="block examples">
<div class="container clearfix">
<h3 class="block-title">Examples</h3>

<ul>
<li>
<a href="https://github.com/GoogleCloudPlatform/gcloud-python-expenses-demo"><code>gcloud-python-expenses-demo</code></a> - Use gcloud-python with the Datastore and Cloud Storage to manage expenses
</li>
</ul>
</div>
</section>

<section class="block">
<div class="container clearfix">
<h3 class="block-title">FAQ</h3>

<h4>What is the relationship between the <code>gcloud</code> package
and the <code>gcloud</code> command-line tool?</h4>
<p>Both the <code>gcloud</code> command-line tool and
<code>gcloud</code> package 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 <code>gcloud</code> command-line
tool can be used to manage both your development workflow and your
Google Cloud Platform resources while the <code>gcloud</code> package is the
Google Cloud Client Library for Python.</p>

<h4>What is the relationship between <code>gcloud</code>
and the Google APIs Python Client?</h4>
<p>The <a href="https://github.com/google/google-api-python-client">
Google APIs Python Client</a> is a client library for
using the broad set of Google APIs.
<code>gcloud</code> is built specifically for the Google Cloud Platform
and is the recommended way to integrate Google Cloud APIs into your
Python applications. If your application requires both Google Cloud Platform and
other Google APIs, the 2 libraries may be used by your application.</p>
</div>
</section> <!-- end of FAQ -->
20 changes: 20 additions & 0 deletions docs/json/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html><html><head><meta charset="utf-8"><title>gcloud</title><meta name="description" content="Google Cloud Platform's client library documentation"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="shortcut icon" href="https://cloud.google.com/images/gcp-favicon.ico"><link rel="stylesheet" href="src/vendor-d362a4bbd8.css"><link rel="stylesheet" href="src/app-a103c713b2.css"></head><body><!--[if lt IE 10]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]--><main ui-view="" autoscroll="true"></main><script src="src/vendor-7173ada14e.js"></script><script src="src/app-fdd83dcdd8.js"></script><script>
(function() {
var $injector = angular.injector(['ng']);
var $http = $injector.get('$http');

$http.get('manifest.json')
.then(function(response) {
angular
.module('gcloud.manifest', [])
.constant('manifest', response.data);

angular.element(document)
.ready(function() {
angular.bootstrap(document, ['gcloud']);
});
});
}());
</script></body></html>
8 changes: 8 additions & 0 deletions docs/json/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"description": "<div class=\"section\"><h2><code>gcloud-python</code></h2><p>GCloud API access in idiomatic Python.</p></div>",
"examples": ["import gcloud"],
"id": "gcloud.__init__",
"methods": [],
"name": "__Init__",
"source": "/gcloud/__init__.py"
}
12 changes: 6 additions & 6 deletions docs/json/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"lang": "python",
"friendlyLang": "Python",
"markdown": "python",
"titleDelimiter": ".",
"versions": [
"v0.9.0",
"v0.8.0",
"v0.7.1",
"v0.7.0",
"v0.6.0",
"v0.5.0",
"master"
],
"content": "json",
"home": "home.html",
"package": {
"title": "PyPI",
"href": "https://pypi.python.org/pypi/gcloud"
},
"latestRelease": {
"name": "master",
"date": 1455306471454,
"link": "https://github.com/GoogleCloudPlatform/gcloud-python/tree/master"
}
}
57 changes: 57 additions & 0 deletions docs/json/overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<h2>Getting started</h2>

<p>
The <code>gcloud</code> library is <code>pip</code> install-able:
</p>

<div hljs>
$ pip install gcloud
</div>

<p>
If you want to install <code>gcloud-python</code> from source,
you can clone the repository from GitHub:
</p>

<div hljs>
$ git clone git://github.com/GoogleCloudPlatform/gcloud-python.git
$ cd gcloud-python
$ python setup.py install
</div>

<hr>

<h3>Cloud Datastore</h3>

<p>
<a href="https://developers.google.com/datastore/">Google Cloud Datastore</a> is a fully managed,
schemaless database for storing non-relational data.
</p>

<div hljs>

from gcloud import datastore

client = datastore.Client()
key = client.key('Person')

entity = datastore.Entity(key=key)
entity['name'] = 'Your name'
entity['age'] = 25
client.put(entity)
</div>

<h3>Cloud Storage</h3>

<p>
<a href="https://developers.google.com/storage/">Google Cloud Storage</a> allows you to store data on Google infrastructure.
</p>

<div hljs>
from gcloud import storage

client = storage.Client()
bucket = client.get_bucket('<your-bucket-name>')
blob = bucket.blob('my-test-file.txt')
blob.upload_from_string('this is test content!')
</div>
3 changes: 3 additions & 0 deletions docs/json/src/app-a103c713b2.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/json/src/app-fdd83dcdd8.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/json/src/images/icon-dropdown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions docs/json/src/images/icon-lang-dotnet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions docs/json/src/images/icon-lang-java.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/json/src/images/icon-lang-node-cta.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/json/src/images/icon-lang-node.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit de3d16f

Please sign in to comment.