Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

build: check broken links in generated docs #144

Merged
merged 7 commits into from
Jan 15, 2019
Merged
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
2 changes: 1 addition & 1 deletion .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
8 changes: 8 additions & 0 deletions .kokoro/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ cd $(dirname $0)/..
npm install

npm run docs

# Check broken links
BIN=./node_modules/.bin

npm install broken-link-checker
npm install http-server
$BIN/http-server -p 8080 docs/ &
$BIN/blc http://localhost:8080 -r --exclude www.googleapis.com
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,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.0.0",
Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
* @namespace google.cloud
*/
/**
* @namespace google.cloud.container
* @namespace google.container
*/
/**
* @namespace google.cloud.container.v1
* @namespace google.container.v1
*/
/**
* @namespace google.protobuf
*/

'use strict';
Expand Down
6 changes: 3 additions & 3 deletions src/v1/doc/google/container/v1/doc_cluster_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ const IPAllocationPolicy = {
*
* @property {number} initialNodeCount
* The number of nodes to create in this cluster. You must ensure that your
* Compute Engine <a href="/compute/docs/resource-quotas">resource quota</a>
* Compute Engine [resource quota](https://cloud.google.com/compute/docs/resource-quotas)
* is sufficient for this number of instances. You must also have available
* firewall and routes quota.
* For requests, this field should only be used in lieu of a
Expand Down Expand Up @@ -707,7 +707,7 @@ const IPAllocationPolicy = {
*
* @property {string} currentNodeVersion
* [Output only] Deprecated, use
* [NodePool.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters.nodePool)
* [NodePool.version](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters.nodePools#resource-nodepool)
* instead. The current version of the node software components. If they are
* currently at multiple versions because they're in the process of being
* upgraded, this reflects the minimum version of all nodes.
Expand Down Expand Up @@ -1916,7 +1916,7 @@ const GetNodePoolRequest = {
*
* @property {number} initialNodeCount
* The initial node count for the pool. You must ensure that your
* Compute Engine <a href="/compute/docs/resource-quotas">resource quota</a>
* Compute Engine [resource quota](https://cloud.google.com/compute/docs/resource-quotas)
* is sufficient for this number of instances. You must also have available
* firewall and routes quota.
*
Expand Down
8 changes: 8 additions & 0 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
templates = common_templates.node_library()
s.copy(templates)

s.replace("src/v1/doc/google/container/v1/doc_cluster_service.js",
"<a href=\"\/compute\/docs\/resource-quotas\">resource quota<\/a>",
r"[resource quota](https://cloud.google.com/compute/docs/resource-quotas)")

s.replace("src/v1/doc/google/container/v1/doc_cluster_service.js",
"https:\/\/cloud\.google\.com\/kubernetes-engine\/docs\/reference\/rest\/v1\/projects\.zones\.clusters\.nodePool",
"https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters.nodePools#resource-nodepool")

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