x/pkgsite: Organization of package-level constants #40970
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
pkgsite/dochtml
Issues related to package documentation in pkgsite
pkgsite
Milestone
What did you do?
Visited https://pkg.go.dev/cuelang.org/go/cue?tab=doc
What did you expect to see?
Below the Index (and Package Files) I expected to see all of the constants available in the package.
What did you see instead?
No constants!
Instead, the constants are grouped under their types:
This is not always the case, for example in Logrus:
The difference may be that, because those package-level constants are strings, they have no type to be grouped under and so float to the top. Also, there are some package-level variables that are still at the top—so maybe those are treated differently, or maybe it's because it's a slice of that custom type and the logic doesn't take slices into account.
Notes/Feedback
I could slice the points more finely and articulate them in various ways, but I believe that the original style of overview was better. You could see all types and methods in the Index, (including constructors) and then below that all of the package-level variables—voila, you have seen the package's public API. If you have questions about the type of these constants, you can click them to drill down to the details. Colocating the constants with their types seems to "ease" this click step by sacrificing the overview.
Perhaps, as an alternative, if a type has constants, it can have a link to the Constants section up top?
This is my impression as a user, but I'm curious what other community members think.
The text was updated successfully, but these errors were encountered: