-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
proposal: go/doc: add illustrations to documentation pages #39513
Comments
Also see #16666. |
A possible refinement of this suggestion would be to leverage the fact that directives are not included as part of
and:
|
@julieqiu can you suggest some next steps? (Possibly discussing at the next tools call) |
Here is a mockup of what it would like:
|
Thanks, @ajstarks! I like this suggestion. @jayconrod @bcmills for thoughts on using directives for this. |
The Go project has historically resisted adding much in the way of structured formatting to doc comments (#35947 (comment)) Personally I don't have a strong opinion on the matter either way, but given the history I would be inclined to send this through the proposal process. See also #25444, #16666, #7873, #25449, #18342 (comment). |
@ajstarks - filing a proposal for this issue would be a good next step. See https://github.com/golang/proposal for details. |
thanks @julieqiu . Do I need to make a new proposal issue? Should the Proposal tag be added to this issue? Is a design doc required at this stage? |
I think to start it would be sufficient to turn this issue into a proposal by adding the Proposal label, as described in step 1 of https://github.com/golang/proposal#the-proposal-process. That can be done by adding a "proposal:" prefix to the issue title. You may be asked for a design doc as part of step 2. |
FYI: here is the proposal in more detail: |
I note that the proposal suggests that I think that would put terminal readers at a significant disadvantage vs. the alternative today (explicit URLs), since they wouldn't even know that there was other content available in the documentation. (We probably need to figure out some way to indicate the elided content on the terminal, if not display the content URL.) |
Perhaps I should be more explicit on alt-text handing. The intention is that agents are free to use the alt-text as they see fit. I also could update the recommendations to include "good" alt-text, assuming that it will be rendered. |
I do not have a strong opinion about this, but I think it would be preferable if the magic comment did not look like one. For example, the magic comment may be: "See figure circle.png (ilustration of a circle)". |
@yiyus I like the notion of a more natural language approach very much. Do you have an opinion on the relative difficulty of implementation vs. the // godoc:image method? |
@yiyus, @heschik points out that a convention like “See figure ().” might be challenging for authors of non-English documentation. We have a similar precedent in the |
if we go w/ the it would be quite useful and convenient for packages dealing with graphics, not only to be able to document APIs with pictures, but to also document their examples with those. I guess I am not proposing |
In #51082 we discussed and decided not to do this. |
This proposal has been added to the active column of the proposals project |
@rsc just clarifying that you are saying you decided to defer it, not that it was decided that it should not be done right? in That discussion you specifically say that "images remain out of scope for this change" and I read that to mean that discussion was only narrowed to headings, lists, and links. Regardless, you pointed out some valid issues in that proposal, some being image sizes &resolutions, hints, image sets etc. Even with that complexity however, I am of the opinion that adding doc image support is just too potentially usefull for documenting complicated Systems and adding examples to graphical libraries. |
No change in consensus, so declined. |
What is the URL of the page with the issue?
Any API documentation URL (for example: https://pkg.go.dev/gioui.org/layout?tab=doc)
What is your user agent?
Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
What did you expect to see?
I would like to support adding illustrations to documentation pages. Perhaps one method would be to show an image triggered by a magic comment:
The text was updated successfully, but these errors were encountered: