-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Linking to API object definitions from docs #11569
Conversation
GCE e2e build/test passed for commit 21e113da49342beb2fab8f97b3cebf906e48e904. |
GCE e2e build/test passed for commit 9d25fdb96f96df44222bbfecc0a3778f3e457276. |
|
||
Node is a top-level resource in the kubernetes REST API. More details about the | ||
API object can be found at: [Node API | ||
object](https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api-reference/definitions.html#_v1_node). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the best way is to link to these docs.
We're working to get them on kubernetes.io. However, the standard approach of using a relative link won't work since github won't render html. Similarly, the releases.k8s.io/HEAD redirector won't work, either.
I think we're going to need to link to the versioned docs in kubernetes.io and rewrite the links similar to how we rewrite the redirector links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It would have been great if https://htmlpreview.github.io/?http://releases.k8s.io/HEAD/docs/api-reference/definitions.html#_v1_node worked, but it does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed htmlpreview/htmlpreview.github.com#34 to see if that can be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html#_v1_node does work. I can link to that on HEAD and update mark-new-version to replace HEAD by the new release version as it does for api/*types.go: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/build/mark-new-version.sh#L112.
@bgrant0607 @thockin does that sound good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see
cc @krousey |
Have updated the code to replace all URLs of the form https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api-reference/definitions.html#_v1_node by https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html#_v1_node |
GCE e2e build/test passed for commit 021138b. |
cc @lavalamp |
|
||
Node is a top-level resource in the kubernetes REST API. More details about the | ||
API object can be found at: [Node API | ||
object](https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html#_v1_node). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a relative link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the files are being accessed via htmlpreview.github.io, which needs full target URLs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link checker can't check these links :(
LGTM |
Linking to API object definitions from docs
…#11569-upstream-release-1.0 Automated cherry pick of #11569
Fixes #11467
cc @caesarxuchao @bgrant0607 @erictune