Skip to content
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

x/tools/cmd/godoc: add 'expand all' link to expand all examples #3081

Closed
vdobler opened this issue Feb 20, 2012 · 24 comments
Closed

x/tools/cmd/godoc: add 'expand all' link to expand all examples #3081

vdobler opened this issue Feb 20, 2012 · 24 comments
Labels
FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@vdobler
Copy link
Contributor

vdobler commented Feb 20, 2012

The code examples are initially closed in the html output of
godoc.  While this is perfectly fine for online browsing it
is unsuitable for a printout:  During printing the examples
should be open/folded out.
@dsymonds
Copy link
Contributor

Comment 1:

Printing such pages is not common, but this could be addressed by adding a little JS
toggle at the top to expand/collapse all the examples. I'd imagine some people printing
out reference material would *not* want the examples, so we should make sure that's easy
too.
It doesn't seem high priority, though.

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 3:

Labels changed: added go1.1maybe.

@mewmew
Copy link
Contributor

mewmew commented Oct 9, 2012

Comment 4:

It would be possible to use CSS, if examples should be included by default when
printing. The js 'expand all' link would require user interaction before printing.
@media print
{
   .collapsed
   {
      display: none !important;
   }
   .expanded
   {
      display: block !important;
   }
}

@rsc
Copy link
Contributor

rsc commented Mar 12, 2013

Comment 5:

[The time for maybe has passed.]

Labels changed: removed go1.1maybe.

@adg
Copy link
Contributor

adg commented Mar 18, 2013

Comment 6:

Labels changed: added godoc.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 7:

Labels changed: added go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 8:

Labels changed: added feature.

@robpike
Copy link
Contributor

robpike commented Aug 30, 2013

Comment 9:

Not for 1.2.

Labels changed: removed go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 10:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 11:

Labels changed: removed feature.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 12:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 13:

Labels changed: added repo-tools.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/godoc: add 'expand all' link to expand all examples x/tools/cmd/godoc: add 'expand all' link to expand all examples Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
@agnivade agnivade added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. FeatureRequest labels May 31, 2018
@agnivade
Copy link
Contributor

@andybons / @bradfitz for decision.

@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 11, 2018
@gopherbot gopherbot removed the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jun 11, 2018
@rsc
Copy link
Contributor

rsc commented Jun 11, 2018

Per @andybons and @bradfitz, a trivial CL doing this is OK.

@agnivade
Copy link
Contributor

Perfect, thanks !

@agnivade agnivade self-assigned this Jun 12, 2018
@agnivade
Copy link
Contributor

@bradfitz / @andybons - I have been thinking about where to put this button on the page. I have decided to place it beside the "Example" header under which all examples are listed. It has one click access from the top level ToC and is in a position from where all examples are accessible.

expand1

It looks a bit clumsy to me. But I am not able to find a better place. Let me know if you think of a more suitable place.

/cc @ysmolsky , @jimmyfrasche for more inputs.

@jimmyfrasche
Copy link
Member

jimmyfrasche commented Jun 13, 2018 via email

@agnivade
Copy link
Contributor

True. Maybe I misunderstood; the title does say to add an 'expand all' link. But I don't think we should expand all examples by default during printing, which the comment is doing. The user should be able to control this with a toggle.

@jimmyfrasche
Copy link
Member

jimmyfrasche commented Jun 13, 2018 via email

@agnivade
Copy link
Contributor

Yea, the title and the description are not in sync. ping @vdobler for clarification.

When would you want to exclude some examples when printing?

I might not want to print all examples always. For eg- I might want only 1 or 2 examples. So I can expand them specifically and then print the document. I think that's a fair thing to ask.

@andybons
Copy link
Member

@agnivade I think your position in #3081 (comment) is fine. Let's move forward with that.

@gopherbot
Copy link

Change https://golang.org/cl/118935 mentions this issue: godoc: add link to expand/close all examples

@vdobler
Copy link
Contributor Author

vdobler commented Jun 15, 2018

@agnivade
My original intention was to have all examples printed by default or by clicking once
to open them all. I find it very annoying if I print out documentation just to find out
during reading that half of it is missing because it was an "interactive" document.
Like I do not order individual chapters from a book I like to have the whole together.
Skimming over an uninteresting example is not a big deal for me in a printout.

@agnivade
Copy link
Contributor

Thanks for clarifying.

or by clicking once to open them all.

Cool, we are going with that.

@golang golang locked and limited conversation to collaborators Jun 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

10 participants