Skip to content

cmd/godoc: make it easier to get anchor links #13748

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

Closed
cespare opened this issue Dec 28, 2015 · 2 comments
Closed

cmd/godoc: make it easier to get anchor links #13748

cespare opened this issue Dec 28, 2015 · 2 comments

Comments

@cespare
Copy link
Contributor

cespare commented Dec 28, 2015

godoc's generated HTML includes lots of handy anchor tags for every element of the documentation. If you wish to look up a tag in order to link to a particular section, it's not always easy to get at the tag.

For types, functions, and methods, you can scroll up and find the corresponding index entry and click on that. For subsections of the overview section (e.g. https://golang.org/pkg/text/template/#hdr-Arguments), the link doesn't appear anywhere on the page that I can see. (I usually right click > Inspect in Chrome.)

To make these easier, it would be nice if go/doc's HTML output included a small link beside every anchored element. For one example of how this might look, Github renders markdown with a little anchor link beside each section that only appears on hover. (See https://github.com/golang/go#binary-distribution-notes and hover over "Binary Distribution Notes".)

Another, smaller change that would help is if subsections of the Overview were listed in the index at the very top of the page.

@rsc rsc changed the title go/doc: make it easier to get anchor links cmd/godoc: make it easier to get anchor links Dec 28, 2015
@rsc rsc added this to the Go1.7Early milestone Dec 28, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/20246 mentions this issue.

@bradfitz
Copy link
Contributor

bradfitz commented May 5, 2016

Assigning to @adg to review the outstanding CL. Sorry for the slow review.

@golang golang locked and limited conversation to collaborators May 5, 2017
@rsc rsc unassigned adg Jun 23, 2022
henderjon pushed a commit to oggodoc/godoc that referenced this issue Jun 13, 2024
Added anchor link beside each function, type and method definition in
godoc's generated HTML.  Anchor links are only shown when the mouse is
hovering over the definition.  The link body is the Unicode PILCROW SIGN
character (¶ HTML entity).

Fixes: golang/go#13748

Change-Id: I645269f6c229f76b2882899e1a7483577877ac30
Reviewed-on: https://go-review.googlesource.com/20246
Reviewed-by: Andrew Gerrand <adg@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants