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

go/doc: cross-package doc links don't work #56683

Open
randall77 opened this issue Nov 10, 2022 · 7 comments
Open

go/doc: cross-package doc links don't work #56683

randall77 opened this issue Nov 10, 2022 · 7 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@randall77
Copy link
Contributor

If I change the doc string of (*bytes.Buffer).ReadFrom from containing io.EOF to containing [io.EOF], I expect godoc to render that with an appropriate clickable link to the documentation for io.EOF.

It renders a link but the link doesn't work. When running godoc locally on :6060, the link is http://localhost:6060/io#EOF when it should be http://localhost:6060/pkg/io#EOF.

This page (the Doc links section) says it should work. In fact, this is the exact example shown for this feature.

Intra-package doc links seem to work.

@rsc

@randall77 randall77 added the Tools This label describes issues relating to any tools in the x/tools repository. label Nov 10, 2022
@seankhliao
Copy link
Member

This is a difference between url paths used by pkgsite vs godoc (which was deprecated some time ago).
Note the server referenced in the second paragraph of the linked doc is pkgsite

@randall77
Copy link
Contributor Author

I cannot figure out how to run pkgsite using my local filesystem as the source for the stdlib. When I ask for the docs for a stlib package, pkgsite downloads the stdlib from std@latest, which I guess is tip. How do I convince it to show me the docs for a CL I'm working on?

@cespare
Copy link
Contributor

cespare commented Nov 10, 2022

@randall77 reading https://pkg.go.dev/golang.org/x/pkgsite/cmd/pkgsite it sounds like pointing the -gorepo flag at your repo might work? (I haven't tried.)

@randall77
Copy link
Contributor Author

That didn't work, unfortunately.

@seankhliao
Copy link
Member

cc @jba

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 10, 2022
@mknyszek mknyszek added this to the Backlog milestone Nov 10, 2022
@cespare
Copy link
Contributor

cespare commented Feb 16, 2023

I think the pkgsite issue is #57742.

I ran into the godoc bug too just now. Since pkgsite is such a poor replacement for godoc for local/private usage, perhaps we should undeprecate it (#50229) and fix bugs like this.

@gopherbot
Copy link

Change https://go.dev/cl/477335 mentions this issue: godoc: fix cross-package doc links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants