You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a feature request to add a command-line flag to change the prefix of the URLs generated for source declarations.
For example, when I run pkgsite in a local clone of the kubernetes repo, by clicking around on the API documentation for a package, I can reach this URL:
In particular, the prefix http://localhost:12345/something/ would be an endpoint served by a local gopls instance, and visiting that URL would cause gopls to send a showDocument request to the user's editor to open the named file and line. In this way, the pkgsite browser pane and the user's editor can link to each other, enabling a lightweight interactive process for reviewing API documentation even as the files are being edited.
(A related feature request would be the ability to specify "overlays" of unsaved editor buffers that pkgsite would use instead of the file system, but I suspect that's rather harder. It would allow even unsaved doc edits to be previewed.)
The text was updated successfully, but these errors were encountered:
Having inspected the pkgsite code a little, I think the cleanest seam would be for the Server.InstallFS operation to install an alternative handler when the -files_redirect=http://localhost:12345/something flag is set, and this handler would issue an HTTP redirect to "http://localhost:12345/something" + req.URL.Path. That way all the places that construct /files URLs can be left unchanged, and just the endpoint that handles them will differ.