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: serve status badge similar to godoc.org #36982

Closed
icza opened this issue Feb 2, 2020 · 17 comments
Closed

x/pkgsite: serve status badge similar to godoc.org #36982

icza opened this issue Feb 2, 2020 · 17 comments
Labels
FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite UX Issues that involve UXD/UXR input

Comments

@icza
Copy link

icza commented Feb 2, 2020

What did you do?

It would be nice to have a badge that can be used on other sites (e.g. github.com) that link to the documentation page of the module / package.

For example, using a URL like this:

https://godoc.org/github.com/icza/bitio?status.svg

Serves an image, a badge which is often used on the package's repository to link to the documentation, like this one:

GoDoc

A similar feature like

https://pkg.go.dev/github.com/icza/bitio?status.svg

Would be useful. Some configuration via URL parameters (like size, color etc) would also be cool.

What did you expect to see?

To have a badge image served similar to godoc.org's response.

What did you see instead?

Request is redirected to https://pkg.go.dev/github.com/icza/bitio?tab=doc and the HTML page is served.

@ALTree ALTree added the pkgsite label Feb 3, 2020
@julieqiu julieqiu changed the title go.dev: Serve status badge similar to godoc.org go.dev: serve status badge similar to godoc.org Feb 3, 2020
@gopherbot gopherbot added this to the Unreleased milestone Feb 6, 2020
@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 6, 2020
@oliverpool
Copy link

oliverpool commented Feb 12, 2020

I just handcrafted a badge on https://shields.io:

go.dev reference

[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/url/of/your-module)

Feel free to tweak the parameters to improve it :-)

The resulting svg could be statically saved somewhere on https://pkg.go.dev (since it is not package dependent).

Edit: use flat-square

peterbourgon added a commit to peterbourgon/ff that referenced this issue Feb 13, 2020
nono added a commit to cozy/cozy-stack that referenced this issue Feb 17, 2020
@integrii
Copy link

I was able to get a nice badge for flaggy with the following code in my README.md (inspired from @oliverpool above):

<a href="https://pkg.go.dev/github.com/integrii/flaggy"> <img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white"></a>

codeactual pushed a commit to codeactual/kubeauth that referenced this issue Feb 23, 2020
@julieqiu julieqiu added UX Issues that involve UXD/UXR input NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Feb 28, 2020
@julieqiu
Copy link
Member

Thanks for the suggestions! Our UX team is working on creating a badge for pkg.go.dev documentation reference.

/cc @fflewddur

@quasilyte
Copy link
Contributor

There are tons of godoc badges out there that lead to a site that is basically deprecated.

Is there a reason not to approve the one @oliverpool provided and make it official so everyone can start the migration?

I'm tempted to use it, but if there will be a new recommended badge after several months it will be quite painful to update all README documents again.

Is there a confirmation that an official badge will be provided? I don't want to sound skeptical, but it seems like the priority for this is very low and it can be delayed for ~infinity. :)

Subjectively, it's better to have a "no, unlikely" answer than "yes, there will be" without any guarantees.

@julieqiu
Copy link
Member

julieqiu commented Apr 2, 2020

An official badge will be provided - our goal is to have one available in the next month.

maxatome added a commit to maxatome/go-testdeep that referenced this issue Apr 11, 2020
README godoc badge stays bound to godoc.org until golang/go#36982 is
resolved.

Signed-off-by: Maxime Soulé <btik-git@scoubidou.com>
@lmittmann
Copy link

@julieqiu github.com/google/go-cmp is using this shields.io badge which would be a great default badge:

GoDev

libvirtmirror pushed a commit to libvirt/libvirt-go-xml that referenced this issue Jul 8, 2020
The former is the new recommended frontend for browsing Go API
documentation online.

Note that pkg.go.dev doesn't offer status badges at this point in
time[1], so until that feature is introduced we're going to use a
custom badge made using shields.io.

[1] golang/go#36982

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
libvirtmirror pushed a commit to libvirt/libvirt-go that referenced this issue Jul 8, 2020
The former is the new recommended frontend for browsing Go API
documentation online.

Note that pkg.go.dev doesn't offer status badges at this point in
time[1], so until that feature is introduced we're going to use a
custom badge made using shields.io.

[1] golang/go#36982

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
@gopherbot
Copy link

Change https://golang.org/cl/241273 mentions this issue: content/static: add badge generation for package authors

@oliverpool
Copy link

You can see the rendered version here: https://www.svgviewer.dev/s/SYc1TNlk

ilammy added a commit to ilammy/themis that referenced this issue Jul 13, 2020
Add a badge for GoThemis as well, leading to our pkg.go.dev page.
Unfortunately, this badge needs to be manually updated with each
release. Though, there is an issue tracking badge generation [1].
There has been some recent progress on it, but who knows when it
lands into production.

[1]: golang/go#36982
ilammy added a commit to cossacklabs/themis that referenced this issue Jul 13, 2020
Add a badge for GoThemis as well, leading to our pkg.go.dev page.
Unfortunately, this badge needs to be manually updated with each
release. Though, there is an issue tracking badge generation [1].
There has been some recent progress on it, but who knows when it
lands into production.

[1]: golang/go#36982
@jamalc
Copy link

jamalc commented Jul 14, 2020

You can now generate a badge here: https://pkg.go.dev/badge. I'll update go.dev/about with instructions.

@jamalc
Copy link

jamalc commented Jul 14, 2020

🤦 There is a typo in the markdown snippet #40216. I'll post here again once we deploy the fix.

@ryboe
Copy link

ryboe commented Jul 14, 2020

Thanks, Go team! 👏

You can generate the badge line yourself by following this template:

[![PkgGoDev](https://pkg.go.dev/badge/<MODULE NAME>)](https://pkg.go.dev/<MODULE NAME>)

For example, the badge for my github.com/ryboe/q repo looks like this:

[![PkgGoDev](https://pkg.go.dev/badge/github.com/ryboe/q)](https://pkg.go.dev/github.com/ryboe/q)

@jamalc
Copy link

jamalc commented Jul 15, 2020

The fix for #40216 is out!

@ostcar
Copy link

ostcar commented Jul 16, 2020

Thank you for your work!

The description of the form of the badge generator is a bit misleading. The field is called URL so I expected, that a package path with an (https-) schema was requested. It would be nice, if the generator could detect the schema and remove it. Or the field should be renamed to something like package path.

For example I used the URL

https://github.com/ostcar/topic

But correct is

github.com/ostcar/topic

@jamalc
Copy link

jamalc commented Jul 16, 2020

Hi, ostcar! 👋

Since this issue is closed please file a new issue here where people can discuss. I have a few thoughts on this as well and the work done here is just a starting point to guide building out this feature.

Thank you!

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. pkgsite UX Issues that involve UXD/UXR input
Projects
None yet
Development

No branches or pull requests