### What is the URL of the page with the issue?
https://pkg.go.dev/sort
What is your user agent?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15
Screenshot
Before:
(The colored boxes are my annotations.)
What did you do?
I visited https://pkg.go.dev/sort to find examples.
(The truth is any package with examples will work. Packages that have a large number of examples anchored toward identifiers as opposed to package-level examples really demonstrate the insufficient of the status quo well.)
What did you expect to see?
Per the description that I noted in https://go-review.googlesource.com/c/pkgsite/+/673435, I wanted to have the examples prominently listed, particularly as a top-level item in the TOC and with the example children enumerated. I would want to see the examples presented somewhat similarly to below.
After (applied with change no. 673435):
(The colored boxes are my annotations.)
What did you see instead?
Just an entry in the TOC nested under index for the examples, which does not enumerate what examples are available to a document consumer. See screenshot supra marked as "Before."
Comment From: gabyhelp
Related Issues
- x/pkgsite: Package-level example not showing up on pkg.go.dev #48705 (closed)
- x/pkgsite: documentation feedback - tracking issue #37819 (closed)
- x/pkgsite: display table of contents (TOC) in command documentation #38073 (closed)
- x/pkgsite: missing examples for https://pkg.go.dev/github.com/qqiao/pipeline@v1.0.0 #52363 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: jba
@jamalc Do you see any issues with this UI change?
Comment From: jamalc
This looks great!
@matttproud One thing to note is the TOC does expand and collapse sections based on which heading is closest to the top of the page. Many examples appear below the relevant function or type, so jumping between the example section and other parts of the TOC may be an issue.
Comment From: jba
We can try this and see how it goes.