-
Notifications
You must be signed in to change notification settings - Fork 18k
x/pkgsite: navigation bar loses heading structure from README #43325
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
Comments
Thanks for the feedback! We decided to flatten the hierarchy because users like to do a lot of different things with their README headings. Some examples:
We currently show the highest and second highest levels in the TOC for the README section. If you have suggestions on how to better surface this information, let us know! |
I agree that it does make sense to compress the observed heading range and prune out levels that appear to be too fine-grained. But, rather than flattening the levels that are included, I would like them to be visually distinct in some manner. That could be implemented as different indentation levels, different background colors, different font weights and sizes, or perhaps some other mechanism — the important thing is that they be distinct in some easily-observable way. |
For skip-levels in general, I agree that showing the highest 1–2 levels in the ToC seems reasonable. I have a few other suggestions for that heuristic, but in my opinion none of these suggestions is as important as making the heading levels visually distinct. 🙂
|
Change https://golang.org/cl/309393 mentions this issue: |
The processReadme function now returns a nested table of contents extracted from the readme file based on the hierarchy of headings in the document. If the document has only a single top level heading and that heading has children it is assumed to be a title and removed from the table of contents. For golang/go#43325 Change-Id: I5b67a7e356820477851e6c34493e2517f889b02f Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309393 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://golang.org/cl/310131 mentions this issue: |
The structure of the headings in the readme is now reflected in the readme outline up to three levels of depth. For golang/go#43325 Change-Id: Iee639fea299e93bfd5223dac3a50b663ce0ca89b Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310131 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://golang.org/cl/310371 mentions this issue: |
Change https://golang.org/cl/310372 mentions this issue: |
The container for the mobile outline was part of a template used in the dochtml package making it difficult to extend from the frontend. Limiting the dochtml sidenav-mobile template to the minimum necessary html will allow us to add the readme headings to the mobile outline. This change moves the non-dochtml html to a new file to do just that. For golang/go#43325 Change-Id: Ieef429034e7082215bd2cdb75bbf88f30683cf96 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310371 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Adds top level readme outline headings to the mobile select dropdown nav. For golang/go#43325 Change-Id: Ib2664838303e4b4bcbf54967253f10aa036706f3 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310372 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
These changes are now live. |
What is the URL of the page with the issue?
https://pkg.go.dev/github.com/mattn/go-sqlite3
What is your user agent?
Screenshot
Compare to the
README
as rendered on GitHub:What did you do?
Examine the headings on the left navigation bar.
What did you expect to see?
A clear distinction between topics (
h1
) and subtopics (h2
).What did you see instead?
The
pkg.go.dev
navigation bar does not visibly distinguish between topics and subtopics.The text was updated successfully, but these errors were encountered: