Skip to content

Commit

Permalink
Auto-generate sample READMEs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Aug 30, 2016
1 parent dbaf7b5 commit cc97961
Show file tree
Hide file tree
Showing 23 changed files with 615 additions and 221 deletions.
20 changes: 9 additions & 11 deletions prediction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Machine Learning models.

* [Setup](#setup)
* [Samples](#samples)
* [Hosted Models](#hosted-models)
* [Models](#models)

## Setup

Expand All @@ -25,17 +25,15 @@ Machine Learning models.

## Samples

### Hosted Models
### Models

View the [documentation][hostedmodels_docs] or the [source code][hostedmodels_code].
View the [documentation][models_0_docs] or the [source code][models_0_code].

__Run the sample:__
__Usage:__ `node hostedmodels <phrase>`

Usage: `node hostedmodels "some phrase"`
```
node hostedmodels "Hello world"
```

Example:

node hostedmodels "Hello world"

[hostedmodels_docs]: https://cloud.google.com/prediction/docs/developer-guide#predictionfromappengine
[hostedmodels_code]: hostedmodels.js
[models_0_docs]: https://cloud.google.com/prediction/docs/developer-guide#predictionfromappengine
[models_0_code]: hostedmodels.js
21 changes: 21 additions & 0 deletions prediction/samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"id": "prediction",
"samples": [
{
"id": "models",
"name": "Models",
"file": "hostedmodels.js",
"docs_link": "https://cloud.google.com/prediction/docs/developer-guide#predictionfromappengine",
"usage": {
"text": "node hostedmodels <phrase>"
},
"help": "node hostedmodels \"Hello world\"",
"snippets": [
{
"id": "query",
"region_tag": "predict"
}
]
}
]
}
46 changes: 23 additions & 23 deletions pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ allows you to send and receive messages between independent applications.
* [Samples](#samples)
* [Topics](#topics)
* [Subscriptions](#subscriptions)
* [IAM](#iam)
* [IAM (Identity and Access Management)](#iam-identity-and-access-management)

## Setup

Expand All @@ -29,7 +29,7 @@ allows you to send and receive messages between independent applications.

### Topics

View the [documentation][topics_docs] or the [source code][topics_code].
View the [documentation][topics_0_docs] or the [source code][topics_0_code].

__Usage:__ `node topics --help`

Expand All @@ -53,12 +53,12 @@ Examples:
For more information, see https://cloud.google.com/pubsub/docs
```

[topics_docs]: https://cloud.google.com/pubsub/publisher
[topics_code]: topics.js
[topics_0_docs]: https://cloud.google.com/pubsub/publisher
[topics_0_code]: topics.js

### Subscriptions

View the [documentation][subscriptions_docs] or the [source code][subscriptions_code].
View the [documentation][subscriptions_1_docs] or the [source code][subscriptions_1_code].

__Usage:__ `node subscriptions --help`

Expand All @@ -70,7 +70,7 @@ Commands:
delete <subscription> Delete the specified subscription.
Options:
--help Show help [boolean]
--help Show help [boolean]
Examples:
node subscriptions create my-topic my-subscription Create a new subscription.
Expand All @@ -82,12 +82,12 @@ Examples:
For more information, see https://cloud.google.com/pubsub/docs
```

[subscriptions_docs]: https://cloud.google.com/pubsub/subscriber
[subscriptions_code]: subscriptions.js
[subscriptions_1_docs]: https://cloud.google.com/pubsub/subscriber
[subscriptions_1_code]: subscriptions.js

### IAM
### IAM (Identity and Access Management)

View the [documentation][iam_docs] or the [source code][iam_code].
View the [documentation][iam_2_docs] or the [source code][iam_2_code].

__Usage:__ `node iam --help`

Expand All @@ -96,24 +96,24 @@ Usage: node iam RESOURCE COMMAND [ARGS...]
Resources:
topics
subscriptions
topics
subscriptions
Commands:
get NAME
set NAME
test NAME
get NAME
set NAME
test NAME
Examples:
node iam topics get my-topic
node iam topics set my-topic
node iam topics test my-topic
node iam subscriptions get my-subscription
node iam subscriptions set my-subscription
node iam subscriptions test my-subscription
node iam topics get my-topic
node iam topics set my-topic
node iam topics test my-topic
node iam subscriptions get my-subscription
node iam subscriptions set my-subscription
node iam subscriptions test my-subscription
```

[iam_docs]: https://cloud.google.com/pubsub/access_control
[iam_code]: iam.js
[iam_2_docs]: https://cloud.google.com/pubsub/docs
[iam_2_code]: iam.js
88 changes: 88 additions & 0 deletions pubsub/samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"id": "pubsub",
"samples": [
{
"id": "topics",
"name": "Topics",
"file": "topics.js",
"docs_link": "https://cloud.google.com/pubsub/publisher",
"usage": "node topics --help",
"snippets": [
{
"id": "create",
"region_tag": "create_topic"
},
{
"id": "delete",
"region_tag": "delete_topic"
},
{
"id": "publish",
"region_tag": "publish"
},
{
"id": "list",
"region_tag": "list_topics"
}
]
},
{
"id": "subscriptions",
"name": "Subscriptions",
"file": "subscriptions.js",
"docs_link": "https://cloud.google.com/pubsub/subscriber",
"usage": "node subscriptions --help",
"snippets": [
{
"id": "create",
"region_tag": "create_subscription"
},
{
"id": "delete",
"region_tag": "delete_subscription"
},
{
"id": "list",
"region_tag": "get_all_subscriptions"
},
{
"id": "pull",
"region_tag": "pull_messages"
}
]
},
{
"id": "iam",
"name": "IAM (Identity and Access Management)",
"file": "iam.js",
"docs_link": "https://cloud.google.com/pubsub/docs",
"usage": "node iam --help",
"snippets": [
{
"id": "get-topic-policy",
"region_tag": "get_topic_policy"
},
{
"id": "get-subscription-policy",
"region_tag": "get_subscription_policy"
},
{
"id": "set-topic-policy",
"region_tag": "set_topic_policy"
},
{
"id": "set-subscription-policy",
"region_tag": "set_subscription_policy"
},
{
"id": "test-topic-permissions",
"region_tag": "test_topic_permissions"
},
{
"id": "test-subscription-permissions",
"region_tag": "test_subscription_permissions"
}
]
}
]
}
2 changes: 1 addition & 1 deletion pubsub/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ cli
.example('node $0 pull my-subscription', 'Pull messages from "my-subscription".')
.example('node $0 list', 'List all subscriptions.')
.example('node $0 list my-topic', 'List subscriptions to topic "my-topic".')
.wrap(100)
.wrap(120)
.recommendCommands()
.epilogue('For more information, see https://cloud.google.com/pubsub/docs');

Expand Down
10 changes: 5 additions & 5 deletions resource/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# Google Cloud Resource Manager Node.js Samples
# Google Cloud Resource Manager API Node.js Samples

Google Cloud Platform provides container resources such as Organizations and
Projects, that allow you to group and hierarchically organize other Cloud
Expand Down Expand Up @@ -31,7 +31,7 @@ programmatically manage these container resources.

### Projects

View the [documentation][projects_docs] or the [source code][projects_code].
View the [documentation][projects_0_docs] or the [source code][projects_0_code].

__Usage:__ `node projects --help`

Expand All @@ -40,13 +40,13 @@ Commands:
list List all projects the authenticated user has access to.
Options:
--help Show help [boolean]
--help Show help [boolean]
Examples:
node projects list List projects.
For more information, see https://cloud.google.com/resource-manager/docs/
```

[projects_docs]: https://cloud.google.com/resource-manager/docs/
[projects_code]: projects.js
[projects_0_docs]: https://cloud.google.com/resource-manager/docs/
[projects_0_code]: projects.js
2 changes: 1 addition & 1 deletion resource/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ cli
program.listProjects(makeHandler(true, 'id'));
})
.example('node $0 list', 'List projects.')
.wrap(80)
.wrap(120)
.recommendCommands()
.epilogue('For more information, see https://cloud.google.com/resource-manager/docs/');

Expand Down
18 changes: 18 additions & 0 deletions resource/samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "resource",
"samples": [
{
"id": "projects",
"name": "Projects",
"file": "projects.js",
"docs_link": "https://cloud.google.com/resource-manager/docs/",
"usage": "node projects --help",
"snippets": [
{
"id": "list",
"region_tag": "list_projects"
}
]
}
]
}
42 changes: 18 additions & 24 deletions speech/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

# Google Cloud Speech API Node.js Samples

[Sign up for the Alpha][speech_signup].

The [Cloud Speech API][speech_docs] enables easy integration of Google speech
recognition technologies into developer applications.

[speech_signup]: https://services.google.com/fb/forms/speech-api-alpha/
[speech_docs]: https://cloud.google.com/speech/

## Table of Contents

* [Setup](#setup)
* [Samples](#samples)
* [Recognition](#recognition)
* [Sync Recognize](#sync-recognize)
* [Streaming Recognition](#streaming-recognition)

## Setup

Expand All @@ -28,32 +26,28 @@ recognition technologies into developer applications.

## Samples

### Recognition

View the [documentation][recognition_docs] or the [source code][recognition_code].

__Run the sample:__

Usage: `node recognize <path-to-audio-file>`

Example:
### Sync Recognize

node recognize resources/audio.raw
View the [documentation][recognize_0_docs] or the [source code][recognize_0_code].

[recognition_docs]: https://cloud.google.com/speech/
[recognition_code]: recognize.js
__Usage:__ `node recognize <path-to-audio-file>`

### Recognition (Streaming)
```
node recognize resources/audio.raw
```

View the [documentation][recognition_streaming_docs] or the [source code][recognition_streaming_code].
[recognize_0_docs]: https://cloud.google.com/speech/docs/
[recognize_0_code]: recognize.js

__Run the sample:__
### Streaming Recognition

Usage: `node recognize_streaming <path-to-audio-file>`
View the [documentation][recognize_1_docs] or the [source code][recognize_1_code].

Example:
__Usage:__ `node recognize_streaming <path-to-audio-file>`

node recognize_streaming resources/audio.raw
```
node recognize_streaming resources/audio.raw
```

[recognition_streaming_docs]: https://cloud.google.com/speech/
[recognition_streaming_code]: recognize_streaming.js
[recognize_1_docs]: https://cloud.google.com/speech/docs/
[recognize_1_code]: recognize_streaming.js
Loading

0 comments on commit cc97961

Please sign in to comment.