Skip to content

Commit cc97961

Browse files
committed
Auto-generate sample READMEs.
1 parent dbaf7b5 commit cc97961

23 files changed

Lines changed: 615 additions & 221 deletions

prediction/README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Machine Learning models.
1111

1212
* [Setup](#setup)
1313
* [Samples](#samples)
14-
* [Hosted Models](#hosted-models)
14+
* [Models](#models)
1515

1616
## Setup
1717

@@ -25,17 +25,15 @@ Machine Learning models.
2525

2626
## Samples
2727

28-
### Hosted Models
28+
### Models
2929

30-
View the [documentation][hostedmodels_docs] or the [source code][hostedmodels_code].
30+
View the [documentation][models_0_docs] or the [source code][models_0_code].
3131

32-
__Run the sample:__
32+
__Usage:__ `node hostedmodels <phrase>`
3333

34-
Usage: `node hostedmodels "some phrase"`
34+
```
35+
node hostedmodels "Hello world"
36+
```
3537

36-
Example:
37-
38-
node hostedmodels "Hello world"
39-
40-
[hostedmodels_docs]: https://cloud.google.com/prediction/docs/developer-guide#predictionfromappengine
41-
[hostedmodels_code]: hostedmodels.js
38+
[models_0_docs]: https://cloud.google.com/prediction/docs/developer-guide#predictionfromappengine
39+
[models_0_code]: hostedmodels.js

prediction/samples.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"id": "prediction",
3+
"samples": [
4+
{
5+
"id": "models",
6+
"name": "Models",
7+
"file": "hostedmodels.js",
8+
"docs_link": "https://cloud.google.com/prediction/docs/developer-guide#predictionfromappengine",
9+
"usage": {
10+
"text": "node hostedmodels <phrase>"
11+
},
12+
"help": "node hostedmodels \"Hello world\"",
13+
"snippets": [
14+
{
15+
"id": "query",
16+
"region_tag": "predict"
17+
}
18+
]
19+
}
20+
]
21+
}

pubsub/README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ allows you to send and receive messages between independent applications.
1313
* [Samples](#samples)
1414
* [Topics](#topics)
1515
* [Subscriptions](#subscriptions)
16-
* [IAM](#iam)
16+
* [IAM (Identity and Access Management)](#iam-identity-and-access-management)
1717

1818
## Setup
1919

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

3030
### Topics
3131

32-
View the [documentation][topics_docs] or the [source code][topics_code].
32+
View the [documentation][topics_0_docs] or the [source code][topics_0_code].
3333

3434
__Usage:__ `node topics --help`
3535

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

56-
[topics_docs]: https://cloud.google.com/pubsub/publisher
57-
[topics_code]: topics.js
56+
[topics_0_docs]: https://cloud.google.com/pubsub/publisher
57+
[topics_0_code]: topics.js
5858

5959
### Subscriptions
6060

61-
View the [documentation][subscriptions_docs] or the [source code][subscriptions_code].
61+
View the [documentation][subscriptions_1_docs] or the [source code][subscriptions_1_code].
6262

6363
__Usage:__ `node subscriptions --help`
6464

@@ -70,7 +70,7 @@ Commands:
7070
delete <subscription> Delete the specified subscription.
7171
7272
Options:
73-
--help Show help [boolean]
73+
--help Show help [boolean]
7474
7575
Examples:
7676
node subscriptions create my-topic my-subscription Create a new subscription.
@@ -82,12 +82,12 @@ Examples:
8282
For more information, see https://cloud.google.com/pubsub/docs
8383
```
8484

85-
[subscriptions_docs]: https://cloud.google.com/pubsub/subscriber
86-
[subscriptions_code]: subscriptions.js
85+
[subscriptions_1_docs]: https://cloud.google.com/pubsub/subscriber
86+
[subscriptions_1_code]: subscriptions.js
8787

88-
### IAM
88+
### IAM (Identity and Access Management)
8989

90-
View the [documentation][iam_docs] or the [source code][iam_code].
90+
View the [documentation][iam_2_docs] or the [source code][iam_2_code].
9191

9292
__Usage:__ `node iam --help`
9393

@@ -96,24 +96,24 @@ Usage: node iam RESOURCE COMMAND [ARGS...]
9696
9797
Resources:
9898
99-
topics
100-
subscriptions
99+
topics
100+
subscriptions
101101
102102
Commands:
103103
104-
get NAME
105-
set NAME
106-
test NAME
104+
get NAME
105+
set NAME
106+
test NAME
107107
108108
Examples:
109109
110-
node iam topics get my-topic
111-
node iam topics set my-topic
112-
node iam topics test my-topic
113-
node iam subscriptions get my-subscription
114-
node iam subscriptions set my-subscription
115-
node iam subscriptions test my-subscription
110+
node iam topics get my-topic
111+
node iam topics set my-topic
112+
node iam topics test my-topic
113+
node iam subscriptions get my-subscription
114+
node iam subscriptions set my-subscription
115+
node iam subscriptions test my-subscription
116116
```
117117

118-
[iam_docs]: https://cloud.google.com/pubsub/access_control
119-
[iam_code]: iam.js
118+
[iam_2_docs]: https://cloud.google.com/pubsub/docs
119+
[iam_2_code]: iam.js

pubsub/samples.json

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"id": "pubsub",
3+
"samples": [
4+
{
5+
"id": "topics",
6+
"name": "Topics",
7+
"file": "topics.js",
8+
"docs_link": "https://cloud.google.com/pubsub/publisher",
9+
"usage": "node topics --help",
10+
"snippets": [
11+
{
12+
"id": "create",
13+
"region_tag": "create_topic"
14+
},
15+
{
16+
"id": "delete",
17+
"region_tag": "delete_topic"
18+
},
19+
{
20+
"id": "publish",
21+
"region_tag": "publish"
22+
},
23+
{
24+
"id": "list",
25+
"region_tag": "list_topics"
26+
}
27+
]
28+
},
29+
{
30+
"id": "subscriptions",
31+
"name": "Subscriptions",
32+
"file": "subscriptions.js",
33+
"docs_link": "https://cloud.google.com/pubsub/subscriber",
34+
"usage": "node subscriptions --help",
35+
"snippets": [
36+
{
37+
"id": "create",
38+
"region_tag": "create_subscription"
39+
},
40+
{
41+
"id": "delete",
42+
"region_tag": "delete_subscription"
43+
},
44+
{
45+
"id": "list",
46+
"region_tag": "get_all_subscriptions"
47+
},
48+
{
49+
"id": "pull",
50+
"region_tag": "pull_messages"
51+
}
52+
]
53+
},
54+
{
55+
"id": "iam",
56+
"name": "IAM (Identity and Access Management)",
57+
"file": "iam.js",
58+
"docs_link": "https://cloud.google.com/pubsub/docs",
59+
"usage": "node iam --help",
60+
"snippets": [
61+
{
62+
"id": "get-topic-policy",
63+
"region_tag": "get_topic_policy"
64+
},
65+
{
66+
"id": "get-subscription-policy",
67+
"region_tag": "get_subscription_policy"
68+
},
69+
{
70+
"id": "set-topic-policy",
71+
"region_tag": "set_topic_policy"
72+
},
73+
{
74+
"id": "set-subscription-policy",
75+
"region_tag": "set_subscription_policy"
76+
},
77+
{
78+
"id": "test-topic-permissions",
79+
"region_tag": "test_topic_permissions"
80+
},
81+
{
82+
"id": "test-subscription-permissions",
83+
"region_tag": "test_subscription_permissions"
84+
}
85+
]
86+
}
87+
]
88+
}

pubsub/subscriptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ cli
191191
.example('node $0 pull my-subscription', 'Pull messages from "my-subscription".')
192192
.example('node $0 list', 'List all subscriptions.')
193193
.example('node $0 list my-topic', 'List subscriptions to topic "my-topic".')
194-
.wrap(100)
194+
.wrap(120)
195195
.recommendCommands()
196196
.epilogue('For more information, see https://cloud.google.com/pubsub/docs');
197197

resource/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<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"/>
22

3-
# Google Cloud Resource Manager Node.js Samples
3+
# Google Cloud Resource Manager API Node.js Samples
44

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

3232
### Projects
3333

34-
View the [documentation][projects_docs] or the [source code][projects_code].
34+
View the [documentation][projects_0_docs] or the [source code][projects_0_code].
3535

3636
__Usage:__ `node projects --help`
3737

@@ -40,13 +40,13 @@ Commands:
4040
list List all projects the authenticated user has access to.
4141
4242
Options:
43-
--help Show help [boolean]
43+
--help Show help [boolean]
4444
4545
Examples:
4646
node projects list List projects.
4747
4848
For more information, see https://cloud.google.com/resource-manager/docs/
4949
```
5050

51-
[projects_docs]: https://cloud.google.com/resource-manager/docs/
52-
[projects_code]: projects.js
51+
[projects_0_docs]: https://cloud.google.com/resource-manager/docs/
52+
[projects_0_code]: projects.js

resource/projects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cli
6363
program.listProjects(makeHandler(true, 'id'));
6464
})
6565
.example('node $0 list', 'List projects.')
66-
.wrap(80)
66+
.wrap(120)
6767
.recommendCommands()
6868
.epilogue('For more information, see https://cloud.google.com/resource-manager/docs/');
6969

resource/samples.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"id": "resource",
3+
"samples": [
4+
{
5+
"id": "projects",
6+
"name": "Projects",
7+
"file": "projects.js",
8+
"docs_link": "https://cloud.google.com/resource-manager/docs/",
9+
"usage": "node projects --help",
10+
"snippets": [
11+
{
12+
"id": "list",
13+
"region_tag": "list_projects"
14+
}
15+
]
16+
}
17+
]
18+
}

speech/README.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22

33
# Google Cloud Speech API Node.js Samples
44

5-
[Sign up for the Alpha][speech_signup].
6-
75
The [Cloud Speech API][speech_docs] enables easy integration of Google speech
86
recognition technologies into developer applications.
97

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

1310
## Table of Contents
1411

1512
* [Setup](#setup)
1613
* [Samples](#samples)
17-
* [Recognition](#recognition)
14+
* [Sync Recognize](#sync-recognize)
15+
* [Streaming Recognition](#streaming-recognition)
1816

1917
## Setup
2018

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

2927
## Samples
3028

31-
### Recognition
32-
33-
View the [documentation][recognition_docs] or the [source code][recognition_code].
34-
35-
__Run the sample:__
36-
37-
Usage: `node recognize <path-to-audio-file>`
38-
39-
Example:
29+
### Sync Recognize
4030

41-
node recognize resources/audio.raw
31+
View the [documentation][recognize_0_docs] or the [source code][recognize_0_code].
4232

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

46-
### Recognition (Streaming)
35+
```
36+
node recognize resources/audio.raw
37+
```
4738

48-
View the [documentation][recognition_streaming_docs] or the [source code][recognition_streaming_code].
39+
[recognize_0_docs]: https://cloud.google.com/speech/docs/
40+
[recognize_0_code]: recognize.js
4941

50-
__Run the sample:__
42+
### Streaming Recognition
5143

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

54-
Example:
46+
__Usage:__ `node recognize_streaming <path-to-audio-file>`
5547

56-
node recognize_streaming resources/audio.raw
48+
```
49+
node recognize_streaming resources/audio.raw
50+
```
5751

58-
[recognition_streaming_docs]: https://cloud.google.com/speech/
59-
[recognition_streaming_code]: recognize_streaming.js
52+
[recognize_1_docs]: https://cloud.google.com/speech/docs/
53+
[recognize_1_code]: recognize_streaming.js

0 commit comments

Comments
 (0)