-
Notifications
You must be signed in to change notification settings - Fork 18k
x/pkgsite: should exploit information provided by source file organisation #7116
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
When the Index section is expanded, we could have a toggle for sorting by file. When toggled, all members in the index could be grouped by the file they are defined in (in order of file name alphabetically). The file name could be slightly highlighted as a not-so-large header before its index contents. This brings up a some concerns:
@agnivade I wonder if you have thoughts on this/other solutions. (When this issue was created, godoc already had the "Package files" section so that's certainly not a solution to this. Not to mention that section links to source files (not godoc) and is also not a "mechanism".) |
This issue is difficult to tackle as we have to apply lot of heuristics to get it right, and different users organize their files in their own way, as you have pointed out. Currently, godoc shows the documentation in a consistent way which is important when the user is working with multiple projects of varying styles. Changing the rendered output depending on the source file organization is too brittle and prone to change, the moment somebody shifts code around. If the aim for godoc is to expose human organisation of the source code, I would argue that adding hotlinks and sections (not just ToC, but a magic word for sections which group related functions and types together #18342 (comment)) provide a better solution to this. We can let those happen first, and then come back and revisit this IMO. |
Let's fold this into #44447 |
The text was updated successfully, but these errors were encountered: