mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-07-21 04:11:05 +02:00
* 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`
26 lines
631 B
Python
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} | ':<84}|"
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|