Files
anybadge/build_examples.py
Jon Grace-Cox 8a434d95b5 Drop <3.7 support and add type hints (#59)
- Drop support for Python <3.7
- Bump the pre-commit version used in CI
- Add type hinting and docstrings
- Add mypy to pre-commit config
- Fix typing issues
- Update colors module
  - Update colors module to use uppercase hex codes
  - Add `__lt__` to allow sorting colors by name
- Fix `build_examples.py` to work with color Enum
- Update example badges in `README.md`
- Fix typing issues in server
- Update travis links in `README.md`
- Fix PyPi deployment bug (#60)
2022-08-08 23:19:50 -04:00

23 lines
607 B
Python

import anybadge
if __name__ == "__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}|"
)