Files
anybadge/build_examples.py
Jon Grace-Cox 56a1935ff0 Add pre-commit config and apply changes
- Add .pre-commit-config.yaml with initial config.
- Add python black pre-commit config
- Apply pre-commit code changes
- Add information to CONTRIBUTING.md
- Add pre-commit to build requirements
- Run pre-commit during travis CI build
- Use a travis build matrix to control when pre-commit runs
  in the CI process. Use explicit include to only run
  pre-commit on Python 3.9.
2022-08-08 15:59:33 -07:00

24 lines
612 B
Python

import anybadge
if __name__ == "__main__":
print(
"""| Color Name | Hex Code | Example |
| ---------- | -------- | ------- |"""
)
for color, hex in sorted(anybadge.COLORS.items()):
file = "examples/color_" + color + ".svg"
url = "https://cdn.rawgit.com/jongracecox/anybadge/master/" + file
anybadge.Badge(label="Color", value=color, default_color=color).write_badge(
file, overwrite=True
)
print(
"| {color} | {hex} | ![]({url}) |".format(
color=color, hex=hex.upper(), url=url
)
)