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

WIP: Json documentation generation #1775

Merged
merged 5 commits into from
Jul 22, 2016
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ script:
- tox -e lint
- 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> pip install <code class="subtle--blue">--upgrade</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-gray.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" />
PyPI
</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-4918b7fab6.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"
}
20 changes: 20 additions & 0 deletions docs/json/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"lang": "python",
"friendlyLang": "Python",
"markdown": "python",
"titleDelimiter": ".",
"versions": [
"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>
1 change: 1 addition & 0 deletions docs/json/src/app-4918b7fab6.js

Large diffs are not rendered by default.

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