Files
anybadge/build_examples.py
Jon Grace-Cox 1c986d4ad8 Add package testing to CI (#68)
* Make `build_examples.py` callable from python
* Allow tests to run from outside project directory
* Add invoke tasks
* Add server tests
* Run travis tests against wheel package instead of local code
* Update `badge.write_badge()` to support `pathlib.Path`
* Update `CONTRIBUTING.md`
2022-08-13 13:22:15 -04:00

26 lines
631 B
Python

import anybadge
def main():
print(
"""
| Color Name | Hex | Example |
| ------------- | ------- | ------- |"""
)
for color in sorted(anybadge.colors.Color):
file = "examples/color_" + color.name.lower() + ".svg"
url = "https://cdn.rawgit.com/jongracecox/anybadge/master/" + file
anybadge.Badge(
label="Color", value=color.name.lower(), default_color=color.value
).write_badge(file, overwrite=True)
print(
f"| {color.name.lower():<13} | {color.value.upper():<7} | ![]({f'{url})':<84}|"
)
if __name__ == "__main__":
main()