anybadge icon indicating copy to clipboard operation
anybadge copied to clipboard

Add logo support

Open jongracecox opened this issue 4 years ago • 6 comments

It would be nice to have the option to include logos in badges.

jongracecox avatar Mar 20 '20 12:03 jongracecox

In the same line as this, it would be nice to be able to use the stargazers-style badge: image

jongracecox avatar Jun 23 '20 04:06 jongracecox

This is similar to #43 in terms of embedding an image via URL(?), although the location would be fixed with this.

It would be nice to have pre-defined locations (e.g. left or right).

A basic first stab at the tasks:

  • [ ] Add logo_url argument to badge constructor.
  • [ ] Add logo_position argument (that would accept left or right)
  • [ ] Static variables to denote left or right (e.g. LOGO_POSITION_LEFT and LOGO_POSITION_RIGHT)
  • [ ] Command line arguments for url and position constructor args.
  • [ ] Add unit testing
  • [ ] Update documentation
  • [ ] Update repl.it

jongracecox avatar Jul 15 '20 14:07 jongracecox

Images can be embedded into the SVG to make them self-contained using an image tag with xlink and a base64 encoding of the image.

<image width="100" height="100" xlink:href="data:image/png;base64,...">

jongracecox avatar Jul 16 '20 12:07 jongracecox

embedding an image via URL(?), although the location would be fixed with this

I really appreciate anybadge generating static SVGs. Part of its appeal to me over Shields.io (while awesome!) is that image is just loaded as-is. My project's CI job(s) will update badges with new content. Personal preference would be to avoid fetching the icon every time the image is loaded.

However, I do like pretty icons as well!

I notice that https://simpleicons.org/ provides (free?) SVGs. What if anybadge downloaded the requested icon and embedded it in the output SVG?

ahogen avatar Sep 28 '20 18:09 ahogen

+1

eggplants avatar May 13 '22 19:05 eggplants

This site has a lot of examples: https://github.com/Naereen/badges Some include icons and embedded PNG images.

jongracecox avatar Aug 14 '22 16:08 jongracecox