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

Auto-generate sample READMEs. #195

Closed
wants to merge 1 commit into from
Closed
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
88 changes: 39 additions & 49 deletions bigquery/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<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 BigQuery Node.js Samples
# BigQuery Node.js Samples

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

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

* [Setup](#setup)
* [Samples](#samples)
* [Create A Simple Application With the API](#create-a-simple-application-with-the-api)
* [Datasets](#datasets)
* [Queries](#queries)
* [Tables](#tables)
* [Queries](#queries)

## Setup

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

## Samples

### Create A Simple Application With the API

View the [documentation][basics_docs] or the [source code][basics_code].

__Run the sample:__

node getting_started

[basics_docs]: https://cloud.google.com/bigquery/create-simple-app-api
[basics_code]: getting_started.js

### Datasets

View the [documentation][datasets_docs] or the [source code][datasets_code].
View the [documentation][datasets_0_docs] or the [source code][datasets_0_code].

__Usage:__ `node datasets --help`

Expand All @@ -54,8 +42,8 @@ Commands:

Options:
--projectId, -p Optionally specify the project ID to use.
[string]
--help Show help [boolean]
[string] [default: "nodejs-docs-samples"]
--help Show help [boolean]

Examples:
node datasets create my_dataset Create a new dataset named "my_dataset".
Expand All @@ -70,38 +58,12 @@ Examples:
For more information, see https://cloud.google.com/bigquery/docs
```

[datasets_docs]: https://cloud.google.com/bigquery/docs
[datasets_code]: datasets.js

### Queries

View the [documentation][queries_docs] or the [source code][queries_code].

__Usage:__ `node queries --help`

```
Commands:
sync <query> Run a synchronous query.
async <query> Start an asynchronous query.
poll <jobId> Get the status of a job.

Options:
--help Show help [boolean]

Examples:
node queries sync "SELECT * FROM publicdata:samples.natality LIMIT 5;"
node queries async "SELECT * FROM publicdata:samples.natality LIMIT 5;"
node queries poll 12345

For more information, see https://cloud.google.com/bigquery/docs
```

[queries_docs]: https://cloud.google.com/bigquery/docs
[queries_code]: queries.js
[datasets_0_docs]: https://cloud.google.com/bigquery/docs
[datasets_0_code]: datasets.js

### Tables

View the [documentation][tables_docs] or the [source code][tables_code].
View the [documentation][tables_1_docs] or the [source code][tables_1_code].

__Usage:__ `node tables --help`

Expand Down Expand Up @@ -132,5 +94,33 @@ Examples:
For more information, see https://cloud.google.com/bigquery/docs
```

[tables_docs]: https://cloud.google.com/bigquery/docs
[tables_code]: tables.js
[tables_1_docs]: https://cloud.google.com/bigquery/docs
[tables_1_code]: tables.js

### Queries

View the [documentation][queries_2_docs] or the [source code][queries_2_code].

__Usage:__ `node queries --help`

```
Commands:
sync <query> Run a synchronous query.
async <query> Start an asynchronous query.
poll <jobId> Get the status of a job.

Options:
--help Show help [boolean]

Examples:
node queries sync "SELECT * FROM
publicdata:samples.natality LIMIT 5;"
node queries async "SELECT * FROM
publicdata:samples.natality LIMIT 5;"
node queries poll 12345

For more information, see https://cloud.google.com/bigquery/docs
```

[queries_2_docs]: https://cloud.google.com/bigquery/docs
[queries_2_code]: queries.js
26 changes: 26 additions & 0 deletions bigquery/samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "bigquery",
"samples": [
{
"id": "datasets",
"name": "Datasets",
"file": "datasets.js",
"docs_link": "https://cloud.google.com/bigquery/docs",
"usage": "node datasets --help"
},
{
"id": "tables",
"name": "Tables",
"file": "tables.js",
"docs_link": "https://cloud.google.com/bigquery/docs",
"usage": "node tables --help"
},
{
"id": "queries",
"name": "Queries",
"file": "queries.js",
"docs_link": "https://cloud.google.com/bigquery/docs",
"usage": "node queries --help"
}
]
}
46 changes: 20 additions & 26 deletions datastore/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 Datastore Node.js Samples
# Datastore Node.js Samples

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

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

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

## Samples

### Getting started with Google Cloud Datastore API
### Tasks

View the [documentation][tasks_docs] or the [source code][tasks_code].
View the [documentation][tasks_0_docs] or the [source code][tasks_0_code].

__Run the sample:__
__Usage:__ `node tasks --help`

Usage: `node tasks <command> [args]...`
```
Usage:

Print usage:
new <description> Adds a task with a description <description>
done <task-id> Marks a task as done
list Lists all tasks by creation time
delete <task-id> Deletes a task
```

node tasks

Example:

node tasks list

[tasks_docs]: https://cloud.google.com/datastore/docs/datastore-api-tutorial
[tasks_code]: tasks.js
[tasks_0_docs]: https://cloud.google.com/datastore/docs/datastore-api-tutorial
[tasks_0_code]: tasks.js

### Concepts

View the [documentation][concepts_docs] or the [source code][concepts_code].

[concepts_docs]: https://cloud.google.com/datastore/docs/concepts/entities
[concepts_code]: concepts.js
View the [documentation][concepts_1_docs] or the [source code][concepts_1_code].[concepts_1_docs]: https://cloud.google.com/datastore/docs/concepts/entities
[concepts_1_code]: concepts.js

### Errors and Error Handling

View the [documentation][error_docs] or the [source code][error_code].

__Run the sample:__

node error
View the [documentation][error_2_docs] or the [source code][error_2_code].

[error_docs]: https://cloud.google.com/datastore/docs/concepts/errors
[error_code]: error.js
__Usage:__ `node error`
[error_2_docs]: https://cloud.google.com/datastore/docs/concepts/errors
[error_2_code]: error.js
27 changes: 27 additions & 0 deletions datastore/samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"id": "datastore",
"samples": [
{
"id": "tasks",
"name": "Tasks",
"file": "tasks.js",
"docs_link": "https://cloud.google.com/datastore/docs/datastore-api-tutorial",
"usage": "node tasks --help"
},
{
"id": "concepts",
"name": "Concepts",
"file": "concepts.js",
"docs_link": "https://cloud.google.com/datastore/docs/concepts/entities"
},
{
"id": "error",
"name": "Errors and Error Handling",
"file": "error.js",
"docs_link": "https://cloud.google.com/datastore/docs/concepts/errors",
"usage": {
"text": "node error"
}
}
]
}
21 changes: 12 additions & 9 deletions language/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Learning API.

### Analyze

View the [documentation][analyze_docs] or the [source code][analyze_code].
View the [documentation][analyze_0_docs] or the [source code][analyze_0_code].

__Usage:__ `node analyze --help`

Expand All @@ -43,20 +43,23 @@ Commands:
syntaxFromFile <bucket> <filename> Detect the syntax of text in a GCS file.

Options:
--language, -l The language of the text. [string]
--type, -t Type of text [string] [choices: "text", "html"] [default: "text"]
--help Show help [boolean]
--language, -l The language of the text. [string]
--type, -t Type of text. [string] [choices: "text", "html"] [default: "text"]
--help Show help [boolean]

Examples:
node analyze sentimentFromString "President Obama is speaking at the White House."
node analyze sentimentFromString "President Obama is
speaking at the White House."
node analyze sentimentFromFile my-bucket file.txt
node analyze entitiesFromString "<p>President Obama is speaking at the White House.</p>" -t html
node analyze entitiesFromString "<p>President Obama is
speaking at the White House.</p>" -t html
node analyze entitiesFromFile my-bucket file.txt
node analyze syntaxFromString "President Obama is speaking at the White House."
node analyze syntaxFromString "President Obama is speaking
at the White House."
node analyze syntaxFromFile my-bucket es_file.txt -l es

For more information, see https://cloud.google.com/natural-language/docs
```

[analyze_docs]: https://cloud.google.com/natural-language/docs
[analyze_code]: analyze.js
[analyze_0_docs]: https://cloud.google.com/natural-language/docs/
[analyze_0_code]: analyze.js
2 changes: 1 addition & 1 deletion language/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ cli
.example('node $0 entitiesFromFile my-bucket file.txt', '')
.example('node $0 syntaxFromString "President Obama is speaking at the White House."', '')
.example('node $0 syntaxFromFile my-bucket es_file.txt -l es', '')
.wrap(100)
.wrap(120)
.recommendCommands()
.epilogue('For more information, see https://cloud.google.com/natural-language/docs');

Expand Down
12 changes: 12 additions & 0 deletions language/samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "nl",
"samples": [
{
"id": "analyze",
"name": "Analyze",
"file": "analyze.js",
"docs_link": "https://cloud.google.com/natural-language/docs/",
"usage": "node analyze --help"
}
]
}
Loading