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/pkgsite: comments in example code are not visible #40710

Closed
cgxeiji opened this issue Aug 12, 2020 · 3 comments
Closed

x/pkgsite: comments in example code are not visible #40710

cgxeiji opened this issue Aug 12, 2020 · 3 comments

Comments

@cgxeiji
Copy link

@cgxeiji cgxeiji commented Aug 12, 2020

Sometimes, adding comments to the examples can help illustrate how a package works.

While godoc.org shows comments in the example code, pkg.go.dev does not (example code in pkg.go.dev) for the same package.

I do not know if this is intended behavior, or if comments in examples should be avoided.

Thank you

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Aug 17, 2020

Thanks for reporting. Comments in the example code should be shown. They're shown on golang.org/pkg (aka x/tools/cmd/godoc) and on godoc.org (as you said). This looks like a bug in x/pkgsite.

/cc @julieqiu @jba @jamalc per owners.

@dmitshur dmitshur changed the title x/pkgsite: Comments in examples are not shown x/pkgsite: comments in example code are not visible Aug 17, 2020
@dmitshur dmitshur added the pkgsite label Aug 17, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 18, 2020

Change https://golang.org/cl/248997 mentions this issue: internal/fetch: add comments in example code

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 18, 2020
Change current render implementation of example code to display
comments.

before: https://i.imgur.com/vQYHEn6.png
after: https://i.imgur.com/wS5maVS.png

Updates golang/go#40710

Change-Id: I51fafbc49cc753179bdca997f1ea4df2f17127b5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/248997
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Aug 28, 2020

Fixed.

@julieqiu julieqiu closed this Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants