-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/pkgsite: hide deprecated things from documentation page by default #40850
Comments
I would like to work on it. cc: @julieqiu |
Thanks @nasirhm! If you're interested in working on this feature, please share a plan on this issue first. It looks like @dsnet might have also worked on a prototype in the past based on #17056 (comment). |
Relaying a message from
|
That's a good point, it seems really bad to have documentation for a thing just magically go missing. Clear deprecation warnings would be good. |
The counterpoint to my mind is that for new users it is probably the better thing to hide deprecated identifiers by default, so as not to clutter the API/documentation. |
It also means that pkg.go.dev and godoc should probably use more explicit styling on symbols marked with a canonical |
Change https://golang.org/cl/312270 mentions this issue: |
The Package.Render method is only used on the worker to get the synopsis and other doc-related information. Ever since we started rendering doc on the frontend, the worker has ignored the rendered documentation. So stop rendering the doc, and rename the method to DocInfo to reflect that. One minor consequence is that we no longer flag packages with excessively large doc as having a bad status. As far as the worker is concerned, they are fine; the error will manifest on the frontend (and we will serve a "documentation too large" page). This is all good: we only used a distinct status in this case so we could reprocess if our limits changed, but these modules no longer need reprocessing. For golang/go#40850 Change-Id: I3c7c49f0beb7a6d8a37daabdce75f83ef108eddb Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312270 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
Change https://golang.org/cl/312329 mentions this issue: |
Change https://golang.org/cl/312430 mentions this issue: |
For golang/go#40850 Change-Id: I8cb2de424d8fc6b1ee4f48fa7ed68048340942e2 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312329 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
For golang/go#40850 Change-Id: I82b7b3cd683eedacc6e49e66bca5b5a2f5a19ae8 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312430 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Change https://golang.org/cl/312649 mentions this issue: |
Here is the design as presented in #17056 (comment):
I'll check off items here as they're done. |
Change https://golang.org/cl/312691 mentions this issue: |
Change https://golang.org/cl/312693 mentions this issue: |
@jba. Awesome to see you working on this! What type of declarations can be hidden?
|
Assuming functions are hidden, if I navigate to https://pkg.go.dev/github.com/golang/protobuf/ptypes#Duration, will it auto-unhide the |
I agree that entire packages should not be hidden. I think we should explore what a UI might look like that hides struct fields and interface methods, but that come can be after the initial first step of making it work with top-level decls. |
- Remove old Render method - Remove unit.tmpl - Re-organize template loading - Rename RenderParts to Render For golang/go#40850 Change-Id: Ie27a54b3553ef100b39d472f52b400f8d8d8392e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312649 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
If a symbol is deprecated, don't display it in the outline. This CL only handles the non-mobile outline. For golang/go#40850 Change-Id: Ic758ffa5d811b2a2287c550dddadc38d0a322937 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312691 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
@dsnet, I see you've been here before: indeed, I cannot easily separate a const/var in a block. You'd have to deprecate the entire block. Not great, but the alternative would do too much violence to our fork of go/doc. Better to wait for go/doc/v2. |
@jba, Yea, I last looked at this 3 years ago, but I recall const/var blocks being a challenge. I suspect a good UI for hiding entries in a const/var block could be suitable suitable for hiding struct fields and interface methods, though I don't know exactly how that would look. |
Change https://golang.org/cl/313032 mentions this issue: |
Change https://golang.org/cl/313034 mentions this issue: |
Change https://golang.org/cl/313030 mentions this issue: |
Change https://golang.org/cl/313031 mentions this issue: |
Change https://golang.org/cl/313033 mentions this issue: |
Add a comparison with a golden file to the test, for more thorough coverage. Delete tests that are obsoleted by having a golden. Factor out golden comparison to a separate package. For golang/go#40850 Change-Id: Iac7b4c0e1c4aadad690d8d5118a6861408614aa2 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/313030 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
After parsing the doc, remove deprecated symbols and store them separately. This will keep them out of the index and let us display them separately in the body. For golang/go#40850 Change-Id: Ia80ef20ef79ddad853e31bad4f4fc9805fd43b2c Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/313031 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
Make a separate template for the actual docs of consts, vars, funcs and types. This makes way for rendering deprecated decls separately. For golang/go#40850 Change-Id: I4f5331b897325c35b67d195d168f7d3fc93a8a8c Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/313032 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
Change https://golang.org/cl/314089 mentions this issue: |
Change https://golang.org/cl/314129 mentions this issue: |
Remove the code that split out deprecated symbols. For golang/go#40850 Change-Id: Ibf3cc5bf57a0e450853f9130c489e3f1d78900b6 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/314089 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
For golang/go#40850 Change-Id: If1631c6d56c694dbeee28e4475b0ddaec316d990 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/314129 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
Change https://golang.org/cl/314592 mentions this issue: |
For golang/go#40850 Change-Id: I1b7d2ac03dbba61646a63edc373fe2b9db993756 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/314592 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
Change https://golang.org/cl/323969 mentions this issue: |
Deprecated symbol sections are updated to match UX design. Deprecated sections will expand when navigated to from the index or a direct link. For golang/go#40850 Change-Id: I2108a28d8a4c1655fcad414a239f46605a725673 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/323969 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
This change is now live on https://beta.pkg.go.dev/. |
This change is live on https://pkg.go.dev. |
Such a great change, thank you to everyone who worked on this! |
Related to #17056, we should hide deprecated things from the pkg.go.dev doc page by default.
The text was updated successfully, but these errors were encountered: