Skip to content

Commit

Permalink
build: check broken links in generated docs (#112)
Browse files Browse the repository at this point in the history
* build: check dead links on Kokoro

* recursive crawl local links

* regenerate README.md

* fix timestamp dead link
  • Loading branch information
jkwlui authored Jan 15, 2019
1 parent 7d5f16b commit 1af611b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 54 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-automl/.jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
opts: {
readme: './README.md',
package: './package.json',
template: './node_modules/ink-docstrap/template',
template: './node_modules/jsdoc-baseline',
recurse: true,
verbose: true,
destination: './docs/'
Expand Down
76 changes: 28 additions & 48 deletions packages/google-cloud-automl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,39 @@
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
<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"/>

# [Cloud AutoML: Node.js Client](https://github.com/GoogleCloudPlatform/google-cloud-node)
# [Cloud AutoML: Node.js Client](https://github.com/googleapis/nodejs-automl)

[![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/automl.svg)](https://www.npmjs.org/package/@google-cloud/automl)
[![codecov](https://img.shields.io/codecov/c/github/GoogleCloudPlatform/google-cloud-node/master.svg?style=flat)](https://codecov.io/gh/GoogleCloudPlatform/google-cloud-node)

> Node.js idiomatic client for [AutoML][product-docs].
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-automl/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-automl)

Train high quality custom machine learning models with minimum effort and machine learning expertise


* [AutoML Node.js Client API Reference][client-docs]
* [github.com/GoogleCloudPlatform/google-cloud-node](https://github.com/GoogleCloudPlatform/google-cloud-node)
* [AutoML Documentation][product-docs]

Read more about the client libraries for Cloud APIs, including the older
Google APIs Client Libraries, in [Client Libraries Explained][explained].

[explained]: https://cloud.google.com/apis/docs/client-libraries-explained

**Table of contents:**

* [Quickstart](#quickstart)
* [Before you begin](#before-you-begin)
* [Installing the client library](#installing-the-client-library)
* [Using the client library](#using-the-client-library)
* [Using the client library](#using-the-client-library)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)

## Quickstart

### Before you begin

1. Select or create a Cloud Platform project.

[Go to the projects page][projects]

1. Enable billing for your project.
## Using the client library

[Enable billing][billing]
1. [Select or create a Cloud Platform project][projects].

1. Enable the Cloud AutoML API.
1. [Enable billing for your project][billing].

[Enable the API][enable_api]
1. [Enable the Cloud AutoML API][enable_api].

1. [Set up authentication with a service account][auth] so you can access the
API from your local workstation.

[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=automl
[auth]: https://cloud.google.com/docs/authentication/getting-started
1. Install the client library:

### Installing the client library
npm install --save @google-cloud/automl

npm install --save @google-cloud/automl

### Using the client library
1. Try an example:

```javascript
// Import the Google Cloud client library
const automl = require('@google-cloud/automl');

// Creates a client
const client = new automl.AutoMlClient();

// TBD
```


Expand All @@ -89,15 +55,29 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages]

## Contributing

Contributions welcome! See the [Contributing Guide](https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/.github/CONTRIBUTING.md).
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-automl/blob/master/.github/CONTRIBUTING.md).

## License

Apache Version 2.0

See [LICENSE](https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/LICENSE)
See [LICENSE](https://github.com/googleapis/nodejs-automl/blob/master/LICENSE)

## What's Next

* [AutoML Documentation][product-docs]
* [AutoML Node.js Client API Reference][client-docs]
* [github.com/googleapis/nodejs-automl](https://github.com/googleapis/nodejs-automl)

Read more about the client libraries for Cloud APIs, including the older
Google APIs Client Libraries, in [Client Libraries Explained][explained].

[explained]: https://cloud.google.com/apis/docs/client-libraries-explained

[client-docs]: https://cloud.google.com/nodejs/docs/reference/automl/latest/
[product-docs]: https://cloud.google.com/automl/docs/
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png

[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=automl
[auth]: https://cloud.google.com/docs/authentication/getting-started
2 changes: 1 addition & 1 deletion packages/google-cloud-automl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"eslint-config-prettier": "^3.0.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-prettier": "^3.0.0",
"ink-docstrap": "^1.3.2",
"jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git",
"intelli-espower-loader": "^1.0.1",
"jsdoc": "^3.5.5",
"mocha": "^5.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,11 @@
* 01:30 UTC on January 15, 2017.
*
* In JavaScript, one can convert a Date object to this format using the
* standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
* standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
* method. In Python, a standard `datetime.datetime` object can be converted
* to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
* with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
* can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
* ) to obtain a formatter capable of generating timestamps in this format.
* can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--) to obtain a formatter capable of generating timestamps in this format.
*
* @property {number} seconds
* Represents seconds of UTC time since Unix epoch
Expand Down
11 changes: 11 additions & 0 deletions packages/google-cloud-automl/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@
templates = common_templates.node_library()
s.copy(templates)

# [START fix-dead-link]
s.replace('**/doc/google/protobuf/doc_timestamp.js',
'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)',
r"https://\1)")

s.replace('**/doc/google/protobuf/doc_timestamp.js',
'toISOString\]',
'toISOString)')
# [END fix-dead-link]


# Node.js specific cleanup
subprocess.run(['npm', 'install'])
subprocess.run(['npm', 'run', 'fix'])

0 comments on commit 1af611b

Please sign in to comment.