Skip to content

Commit 982dfae

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

38 files changed

Lines changed: 671 additions & 357 deletions

bigquery/README.md

Lines changed: 39 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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 BigQuery Node.js Samples
3+
# BigQuery Node.js Samples
44

5-
[BigQuery][bigquery_docs] is Google's fully managed, petabyte scale, low cost
5+
[BigQuery][bigquery_docs] is Google&#x27;s fully managed, petabyte scale, low cost
66
analytics data warehouse.
77

88
[bigquery_docs]: https://cloud.google.com/bigquery/docs/
@@ -11,10 +11,9 @@ analytics data warehouse.
1111

1212
* [Setup](#setup)
1313
* [Samples](#samples)
14-
* [Create A Simple Application With the API](#create-a-simple-application-with-the-api)
1514
* [Datasets](#datasets)
16-
* [Queries](#queries)
1715
* [Tables](#tables)
16+
* [Queries](#queries)
1817

1918
## Setup
2019

@@ -28,20 +27,9 @@ analytics data warehouse.
2827

2928
## Samples
3029

31-
### Create A Simple Application With the API
32-
33-
View the [documentation][basics_docs] or the [source code][basics_code].
34-
35-
__Run the sample:__
36-
37-
node getting_started
38-
39-
[basics_docs]: https://cloud.google.com/bigquery/create-simple-app-api
40-
[basics_code]: getting_started.js
41-
4230
### Datasets
4331

44-
View the [documentation][datasets_docs] or the [source code][datasets_code].
32+
View the [documentation][datasets_0_docs] or the [source code][datasets_0_code].
4533

4634
__Usage:__ `node datasets --help`
4735

@@ -54,8 +42,8 @@ Commands:
5442
5543
Options:
5644
--projectId, -p Optionally specify the project ID to use.
57-
[string]
58-
--help Show help [boolean]
45+
[string] [default: "nodejs-docs-samples"]
46+
--help Show help [boolean]
5947
6048
Examples:
6149
node datasets create my_dataset Create a new dataset named "my_dataset".
@@ -70,38 +58,12 @@ Examples:
7058
For more information, see https://cloud.google.com/bigquery/docs
7159
```
7260

73-
[datasets_docs]: https://cloud.google.com/bigquery/docs
74-
[datasets_code]: datasets.js
75-
76-
### Queries
77-
78-
View the [documentation][queries_docs] or the [source code][queries_code].
79-
80-
__Usage:__ `node queries --help`
81-
82-
```
83-
Commands:
84-
sync <query> Run a synchronous query.
85-
async <query> Start an asynchronous query.
86-
poll <jobId> Get the status of a job.
87-
88-
Options:
89-
--help Show help [boolean]
90-
91-
Examples:
92-
node queries sync "SELECT * FROM publicdata:samples.natality LIMIT 5;"
93-
node queries async "SELECT * FROM publicdata:samples.natality LIMIT 5;"
94-
node queries poll 12345
95-
96-
For more information, see https://cloud.google.com/bigquery/docs
97-
```
98-
99-
[queries_docs]: https://cloud.google.com/bigquery/docs
100-
[queries_code]: queries.js
61+
[datasets_0_docs]: https://cloud.google.com/bigquery/docs
62+
[datasets_0_code]: datasets.js
10163

10264
### Tables
10365

104-
View the [documentation][tables_docs] or the [source code][tables_code].
66+
View the [documentation][tables_1_docs] or the [source code][tables_1_code].
10567

10668
__Usage:__ `node tables --help`
10769

@@ -132,5 +94,33 @@ Examples:
13294
For more information, see https://cloud.google.com/bigquery/docs
13395
```
13496

135-
[tables_docs]: https://cloud.google.com/bigquery/docs
136-
[tables_code]: tables.js
97+
[tables_1_docs]: https://cloud.google.com/bigquery/docs
98+
[tables_1_code]: tables.js
99+
100+
### Queries
101+
102+
View the [documentation][queries_2_docs] or the [source code][queries_2_code].
103+
104+
__Usage:__ `node queries --help`
105+
106+
```
107+
Commands:
108+
sync <query> Run a synchronous query.
109+
async <query> Start an asynchronous query.
110+
poll <jobId> Get the status of a job.
111+
112+
Options:
113+
--help Show help [boolean]
114+
115+
Examples:
116+
node queries sync "SELECT * FROM
117+
publicdata:samples.natality LIMIT 5;"
118+
node queries async "SELECT * FROM
119+
publicdata:samples.natality LIMIT 5;"
120+
node queries poll 12345
121+
122+
For more information, see https://cloud.google.com/bigquery/docs
123+
```
124+
125+
[queries_2_docs]: https://cloud.google.com/bigquery/docs
126+
[queries_2_code]: queries.js

bigquery/samples.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"id": "bigquery",
3+
"samples": [
4+
{
5+
"id": "datasets",
6+
"name": "Datasets",
7+
"file": "datasets.js",
8+
"docs_link": "https://cloud.google.com/bigquery/docs",
9+
"usage": "node datasets --help"
10+
},
11+
{
12+
"id": "tables",
13+
"name": "Tables",
14+
"file": "tables.js",
15+
"docs_link": "https://cloud.google.com/bigquery/docs",
16+
"usage": "node tables --help"
17+
},
18+
{
19+
"id": "queries",
20+
"name": "Queries",
21+
"file": "queries.js",
22+
"docs_link": "https://cloud.google.com/bigquery/docs",
23+
"usage": "node queries --help"
24+
}
25+
]
26+
}

datastore/README.md

Lines changed: 20 additions & 26 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 Datastore Node.js Samples
3+
# Datastore Node.js Samples
44

55
[Cloud Datastore][datastore_docs] is a NoSQL document database built for
66
automatic scaling, high performance, and ease of application development.
@@ -11,7 +11,7 @@ automatic scaling, high performance, and ease of application development.
1111

1212
* [Setup](#setup)
1313
* [Samples](#samples)
14-
* [Getting started with Google Cloud Datastore API](#getting-started-with-google-cloud-datastore-api)
14+
* [Tasks](#tasks)
1515
* [Concepts](#concepts)
1616
* [Errors and Error Handling](#errors-and-error-handling)
1717

@@ -27,39 +27,33 @@ automatic scaling, high performance, and ease of application development.
2727

2828
## Samples
2929

30-
### Getting started with Google Cloud Datastore API
30+
### Tasks
3131

32-
View the [documentation][tasks_docs] or the [source code][tasks_code].
32+
View the [documentation][tasks_0_docs] or the [source code][tasks_0_code].
3333

34-
__Run the sample:__
34+
__Usage:__ `node tasks --help`
3535

36-
Usage: `node tasks <command> [args]...`
36+
```
37+
Usage:
3738
38-
Print usage:
39+
new <description> Adds a task with a description <description>
40+
done <task-id> Marks a task as done
41+
list Lists all tasks by creation time
42+
delete <task-id> Deletes a task
43+
```
3944

40-
node tasks
41-
42-
Example:
43-
44-
node tasks list
45-
46-
[tasks_docs]: https://cloud.google.com/datastore/docs/datastore-api-tutorial
47-
[tasks_code]: tasks.js
45+
[tasks_0_docs]: https://cloud.google.com/datastore/docs/datastore-api-tutorial
46+
[tasks_0_code]: tasks.js
4847

4948
### Concepts
5049

51-
View the [documentation][concepts_docs] or the [source code][concepts_code].
52-
53-
[concepts_docs]: https://cloud.google.com/datastore/docs/concepts/entities
54-
[concepts_code]: concepts.js
50+
View the [documentation][concepts_1_docs] or the [source code][concepts_1_code].[concepts_1_docs]: https://cloud.google.com/datastore/docs/concepts/entities
51+
[concepts_1_code]: concepts.js
5552

5653
### Errors and Error Handling
5754

58-
View the [documentation][error_docs] or the [source code][error_code].
59-
60-
__Run the sample:__
61-
62-
node error
55+
View the [documentation][error_2_docs] or the [source code][error_2_code].
6356

64-
[error_docs]: https://cloud.google.com/datastore/docs/concepts/errors
65-
[error_code]: error.js
57+
__Usage:__ `node error`
58+
[error_2_docs]: https://cloud.google.com/datastore/docs/concepts/errors
59+
[error_2_code]: error.js

datastore/samples.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"id": "datastore",
3+
"samples": [
4+
{
5+
"id": "tasks",
6+
"name": "Tasks",
7+
"file": "tasks.js",
8+
"docs_link": "https://cloud.google.com/datastore/docs/datastore-api-tutorial",
9+
"usage": "node tasks --help"
10+
},
11+
{
12+
"id": "concepts",
13+
"name": "Concepts",
14+
"file": "concepts.js",
15+
"docs_link": "https://cloud.google.com/datastore/docs/concepts/entities"
16+
},
17+
{
18+
"id": "error",
19+
"name": "Errors and Error Handling",
20+
"file": "error.js",
21+
"docs_link": "https://cloud.google.com/datastore/docs/concepts/errors",
22+
"usage": {
23+
"text": "node error"
24+
}
25+
}
26+
]
27+
}

language/README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Learning API.
2929

3030
### Analyze
3131

32-
View the [documentation][analyze_docs] or the [source code][analyze_code].
32+
View the [documentation][analyze_0_docs] or the [source code][analyze_0_code].
3333

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

@@ -43,20 +43,23 @@ Commands:
4343
syntaxFromFile <bucket> <filename> Detect the syntax of text in a GCS file.
4444
4545
Options:
46-
--language, -l The language of the text. [string]
47-
--type, -t Type of text [string] [choices: "text", "html"] [default: "text"]
48-
--help Show help [boolean]
46+
--language, -l The language of the text. [string]
47+
--type, -t Type of text. [string] [choices: "text", "html"] [default: "text"]
48+
--help Show help [boolean]
4949
5050
Examples:
51-
node analyze sentimentFromString "President Obama is speaking at the White House."
51+
node analyze sentimentFromString "President Obama is
52+
speaking at the White House."
5253
node analyze sentimentFromFile my-bucket file.txt
53-
node analyze entitiesFromString "<p>President Obama is speaking at the White House.</p>" -t html
54+
node analyze entitiesFromString "<p>President Obama is
55+
speaking at the White House.</p>" -t html
5456
node analyze entitiesFromFile my-bucket file.txt
55-
node analyze syntaxFromString "President Obama is speaking at the White House."
57+
node analyze syntaxFromString "President Obama is speaking
58+
at the White House."
5659
node analyze syntaxFromFile my-bucket es_file.txt -l es
5760
5861
For more information, see https://cloud.google.com/natural-language/docs
5962
```
6063

61-
[analyze_docs]: https://cloud.google.com/natural-language/docs
62-
[analyze_code]: analyze.js
64+
[analyze_0_docs]: https://cloud.google.com/natural-language/docs/
65+
[analyze_0_code]: analyze.js

language/analyze.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ cli
296296
.example('node $0 entitiesFromFile my-bucket file.txt', '')
297297
.example('node $0 syntaxFromString "President Obama is speaking at the White House."', '')
298298
.example('node $0 syntaxFromFile my-bucket es_file.txt -l es', '')
299-
.wrap(100)
299+
.wrap(120)
300300
.recommendCommands()
301301
.epilogue('For more information, see https://cloud.google.com/natural-language/docs');
302302

language/samples.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "nl",
3+
"samples": [
4+
{
5+
"id": "analyze",
6+
"name": "Analyze",
7+
"file": "analyze.js",
8+
"docs_link": "https://cloud.google.com/natural-language/docs/",
9+
"usage": "node analyze --help"
10+
}
11+
]
12+
}

0 commit comments

Comments
 (0)