Skip to content

Commit ba6b13c

Browse files
authored
Merge pull request #1775 from daspecster/json-docs
Json documentation generation
2 parents a609621 + 3ef7819 commit ba6b13c

36 files changed

+2789
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ script:
1212
- tox -e lint
1313
- tox -e system-tests
1414
- tox -e system-tests3
15-
- scripts/update_docs.sh
15+
- scripts/update_json_docs.sh
1616

1717
after_success:
1818
- tox -e coveralls

docs/json/home.html

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<section class="hero-banner">
2+
<div class="container clearfix">
3+
<div class="quote-box">
4+
<h1>gcloud</h1>
5+
<p>Google Cloud Client Library for Python
6+
- an idiomatic, intuitive, and natural way for Python developers to
7+
integrate with Google Cloud Platform services, like Cloud Datastore
8+
and Cloud Storage.</p>
9+
</div>
10+
11+
<div class="quote-box--supplementary">
12+
<pre class="skip-highlight"><code class="subtle--blue">$</code> pip install <code class="subtle--blue">--upgrade</code> <strong>gcloud</strong></pre>
13+
<h4 class="latest-release subtle" ng-if="home.latestRelease">
14+
Latest Release <a ng-href="{{home.latestRelease.link}}" class="latest-release--link white">{{home.latestRelease.name}}</a>
15+
{{home.latestRelease.date|date}}
16+
</h4>
17+
</div>
18+
</div><!-- end of .container -->
19+
</section><!-- end of .hero-banner -->
20+
21+
<section class="block featuring">
22+
<div class="container">
23+
<ul class="featuring-links">
24+
<li>
25+
<a href="#/docs/{{home.latestRelease.name}}/gcloud" title="gcloud-python docs" class="btn btn-docs">
26+
<img src="src/images/icon-lang-python-gray.svg" alt="Python icon" />
27+
Read the Docs
28+
</a>
29+
</li>
30+
<li>
31+
<a href="https://github.com/GoogleCloudPlatform/gcloud-python" title="gcloud-python on GitHub" class="ext-link">
32+
<img src="src/images/icon-link-github.svg" alt="GitHub icon" />
33+
GitHub
34+
</a>
35+
</li>
36+
<li>
37+
<a href="https://github.com/GoogleCloudPlatform/gcloud-python/issues" title="gcloud-python issues on Github" class="ext-link">
38+
<img src="src/images/icon-link-github.svg" alt="GitHub icon" />
39+
Issues
40+
</a>
41+
</li>
42+
<li>
43+
<a href="http://stackoverflow.com/questions/tagged/gcloud-python" title="gcloud-python on StackOverflow" class="ext-link">
44+
<img src="src/images/icon-link-stackoverflow.svg" alt="StackOverflow icon" />
45+
StackOverflow
46+
</a>
47+
</li>
48+
<li>
49+
<a href="https://pypi.python.org/pypi/gcloud" title="gcloud-python on pypi" class="ext-link">
50+
<img src="src/images/icon-link-package-manager.svg" alt="pypi icon" />
51+
PyPI
52+
</a>
53+
</li>
54+
</ul>
55+
</div><!-- end of .container -->
56+
</section><!-- end of .featuring -->
57+
58+
<section class="block about">
59+
<div class="container clearfix">
60+
<div class="quote-box">
61+
<h3 class="block-title">What is it?</h3>
62+
63+
<p><code>gcloud</code> is a client library for accessing Google
64+
Cloud Platform services that significantly reduces the boilerplate
65+
code you have to write. The library provides high-level API
66+
abstractions so they're easier to understand. It embraces
67+
idioms of Python, works well with the standard library, and
68+
integrates better with your codebase.
69+
All this means you spend more time creating code that matters
70+
to you.</p>
71+
72+
<p><code>gcloud</code> is configured to access Google Cloud Platform
73+
services and authorize (OAuth 2.0) automatically on your behalf.
74+
With a one-line install and a private key, you are up and ready
75+
to go. Better yet, if you are running on a Google Compute Engine
76+
instance, the one-line install is enough!</p>
77+
78+
</div>
79+
80+
<div class="quote-box--supplementary">
81+
<h4>Retrieve Datastore Entities</h4>
82+
83+
<div hljs hlsj-language="python">
84+
from gcloud import datastore
85+
86+
client = datastore.Client()
87+
product_key = client.key('Product', 123)
88+
print(client.get(product_key))
89+
</div>
90+
</div>
91+
</div><!-- end of .container -->
92+
</section><!-- end of .featuring -->
93+
94+
<section class="block examples">
95+
<div class="container clearfix">
96+
<h3 class="block-title">Examples</h3>
97+
98+
<ul>
99+
<li>
100+
<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
101+
</li>
102+
</ul>
103+
</div>
104+
</section>
105+
106+
<section class="block">
107+
<div class="container clearfix">
108+
<h3 class="block-title">FAQ</h3>
109+
110+
<h4>What is the relationship between the <code>gcloud</code> package
111+
and the <code>gcloud</code> command-line tool?</h4>
112+
<p>Both the <code>gcloud</code> command-line tool and
113+
<code>gcloud</code> package are a part of the Google Cloud SDK: a collection
114+
of tools and libraries that enable you to easily create and manage
115+
resources on the Google Cloud Platform. The <code>gcloud</code> command-line
116+
tool can be used to manage both your development workflow and your
117+
Google Cloud Platform resources while the <code>gcloud</code> package is the
118+
Google Cloud Client Library for Python.</p>
119+
120+
<h4>What is the relationship between <code>gcloud</code>
121+
and the Google APIs Python Client?</h4>
122+
<p>The <a href="https://github.com/google/google-api-python-client">
123+
Google APIs Python Client</a> is a client library for
124+
using the broad set of Google APIs.
125+
<code>gcloud</code> is built specifically for the Google Cloud Platform
126+
and is the recommended way to integrate Google Cloud APIs into your
127+
Python applications. If your application requires both Google Cloud Platform and
128+
other Google APIs, the 2 libraries may be used by your application.</p>
129+
</div>
130+
</section> <!-- end of FAQ -->

docs/json/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!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]>
2+
<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>
3+
<![endif]--><main ui-view="" autoscroll="true"></main><script src="src/vendor-7173ada14e.js"></script><script src="src/app-4918b7fab6.js"></script><script>
4+
(function() {
5+
var $injector = angular.injector(['ng']);
6+
var $http = $injector.get('$http');
7+
8+
$http.get('manifest.json')
9+
.then(function(response) {
10+
angular
11+
.module('gcloud.manifest', [])
12+
.constant('manifest', response.data);
13+
14+
angular.element(document)
15+
.ready(function() {
16+
angular.bootstrap(document, ['gcloud']);
17+
});
18+
});
19+
}());
20+
</script></body></html>

docs/json/index.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"description": "<div class=\"section\"><h2><code>gcloud-python</code></h2><p>GCloud API access in idiomatic Python.</p></div>",
3+
"examples": ["import gcloud"],
4+
"id": "gcloud.__init__",
5+
"methods": [],
6+
"name": "__Init__",
7+
"source": "/gcloud/__init__.py"
8+
}

docs/json/manifest.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"lang": "python",
3+
"friendlyLang": "Python",
4+
"markdown": "python",
5+
"titleDelimiter": ".",
6+
"versions": [
7+
"master"
8+
],
9+
"content": "json",
10+
"home": "home.html",
11+
"package": {
12+
"title": "PyPI",
13+
"href": "https://pypi.python.org/pypi/gcloud"
14+
},
15+
"latestRelease": {
16+
"name": "master",
17+
"date": 1455306471454,
18+
"link": "https://github.com/GoogleCloudPlatform/gcloud-python/tree/master"
19+
}
20+
}

docs/json/overview.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<h2>Getting started</h2>
2+
3+
<p>
4+
The <code>gcloud</code> library is <code>pip</code> install-able:
5+
</p>
6+
7+
<div hljs>
8+
$ pip install gcloud
9+
</div>
10+
11+
<p>
12+
If you want to install <code>gcloud-python</code> from source,
13+
you can clone the repository from GitHub:
14+
</p>
15+
16+
<div hljs>
17+
$ git clone git://github.com/GoogleCloudPlatform/gcloud-python.git
18+
$ cd gcloud-python
19+
$ python setup.py install
20+
</div>
21+
22+
<hr>
23+
24+
<h3>Cloud Datastore</h3>
25+
26+
<p>
27+
<a href="https://developers.google.com/datastore/">Google Cloud Datastore</a> is a fully managed,
28+
schemaless database for storing non-relational data.
29+
</p>
30+
31+
<div hljs>
32+
33+
from gcloud import datastore
34+
35+
client = datastore.Client()
36+
key = client.key('Person')
37+
38+
entity = datastore.Entity(key=key)
39+
entity['name'] = 'Your name'
40+
entity['age'] = 25
41+
client.put(entity)
42+
</div>
43+
44+
<h3>Cloud Storage</h3>
45+
46+
<p>
47+
<a href="https://developers.google.com/storage/">Google Cloud Storage</a> allows you to store data on Google infrastructure.
48+
</p>
49+
50+
<div hljs>
51+
from gcloud import storage
52+
53+
client = storage.Client()
54+
bucket = client.get_bucket('<your-bucket-name>')
55+
blob = bucket.blob('my-test-file.txt')
56+
blob.upload_from_string('this is test content!')
57+
</div>

docs/json/src/app-4918b7fab6.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/json/src/app-a103c713b2.css

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/json/src/app-fdd83dcdd8.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)