anybadge
anybadge copied to clipboard
Add logo support
It would be nice to have the option to include logos in badges.
In the same line as this, it would be nice to be able to use the stargazers-style badge:
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
andLOGO_POSITION_RIGHT
) - [ ] Command line arguments for url and position constructor args.
- [ ] Add unit testing
- [ ] Update documentation
- [ ] Update repl.it
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,...">
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?
+1
This site has a lot of examples: https://github.com/Naereen/badges Some include icons and embedded PNG images.