mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
refactor: move tooltip text to global constants
This commit is contained in:
parent
9c4d173b1f
commit
3010b94a64
1 changed files with 12 additions and 5 deletions
|
@ -10,6 +10,13 @@ from dotenv import load_dotenv
|
||||||
|
|
||||||
TOKENS_PER_WEEK = "15B"
|
TOKENS_PER_WEEK = "15B"
|
||||||
|
|
||||||
|
# Badge tooltip texts
|
||||||
|
GITHUB_STARS_TOOLTIP = "Total number of GitHub stars the Aider project has received"
|
||||||
|
PYPI_DOWNLOADS_TOOLTIP = "Total number of installations via pip from PyPI"
|
||||||
|
TOKENS_WEEKLY_TOOLTIP = "Number of tokens processed weekly by Aider users"
|
||||||
|
OPENROUTER_TOOLTIP = "Aider's ranking among applications on the OpenRouter platform"
|
||||||
|
SINGULARITY_TOOLTIP = "Percentage of the new code in Aider's last release written by Aider itself"
|
||||||
|
|
||||||
|
|
||||||
def get_total_downloads(api_key, package_name="aider-chat"):
|
def get_total_downloads(api_key, package_name="aider-chat"):
|
||||||
"""
|
"""
|
||||||
|
@ -128,15 +135,15 @@ def generate_badges_md(downloads, stars, aider_percentage):
|
||||||
# Round aider percentage to whole number
|
# Round aider percentage to whole number
|
||||||
aider_percent_rounded = round(aider_percentage)
|
aider_percent_rounded = round(aider_percentage)
|
||||||
|
|
||||||
markdown = f""" <a href="https://github.com/Aider-AI/aider/stargazers"><img alt="GitHub Stars" title="Total number of GitHub stars the Aider project has received"
|
markdown = f""" <a href="https://github.com/Aider-AI/aider/stargazers"><img alt="GitHub Stars" title="{GITHUB_STARS_TOOLTIP}"
|
||||||
src="https://img.shields.io/github/stars/Aider-AI/aider?style=flat-square&logo=github&color=f1c40f&labelColor=555555"/></a>
|
src="https://img.shields.io/github/stars/Aider-AI/aider?style=flat-square&logo=github&color=f1c40f&labelColor=555555"/></a>
|
||||||
<a href="https://pypi.org/project/aider-chat/"><img alt="PyPI Downloads" title="Total number of installations via pip from PyPI"
|
<a href="https://pypi.org/project/aider-chat/"><img alt="PyPI Downloads" title="{PYPI_DOWNLOADS_TOOLTIP}"
|
||||||
src="https://img.shields.io/badge/📦%20Installs-{downloads_formatted}-2ecc71?style=flat-square&labelColor=555555"/></a>
|
src="https://img.shields.io/badge/📦%20Installs-{downloads_formatted}-2ecc71?style=flat-square&labelColor=555555"/></a>
|
||||||
<img alt="Tokens per week" title="Number of tokens processed weekly by Aider users"
|
<img alt="Tokens per week" title="{TOKENS_WEEKLY_TOOLTIP}"
|
||||||
src="https://img.shields.io/badge/📈%20Tokens%2Fweek-{TOKENS_PER_WEEK}-e74c3c?style=flat-square&labelColor=555555"/>
|
src="https://img.shields.io/badge/📈%20Tokens%2Fweek-{TOKENS_PER_WEEK}-e74c3c?style=flat-square&labelColor=555555"/>
|
||||||
<a href="https://openrouter.ai/"><img alt="OpenRouter Ranking" title="Aider's ranking among applications on the OpenRouter platform"
|
<a href="https://openrouter.ai/"><img alt="OpenRouter Ranking" title="{OPENROUTER_TOOLTIP}"
|
||||||
src="https://img.shields.io/badge/🏆%20OpenRouter-Top%2020-9b59b6?style=flat-square&labelColor=555555"/></a>
|
src="https://img.shields.io/badge/🏆%20OpenRouter-Top%2020-9b59b6?style=flat-square&labelColor=555555"/></a>
|
||||||
<a href="https://aider.chat/HISTORY.html"><img alt="Singularity" title="Percentage of the new code in Aider's last release written by Aider itself"
|
<a href="https://aider.chat/HISTORY.html"><img alt="Singularity" title="{SINGULARITY_TOOLTIP}"
|
||||||
src="https://img.shields.io/badge/🔄%20Singularity-{aider_percent_rounded}%25-3498db?style=flat-square&labelColor=555555"/></a>""" # noqa
|
src="https://img.shields.io/badge/🔄%20Singularity-{aider_percent_rounded}%25-3498db?style=flat-square&labelColor=555555"/></a>""" # noqa
|
||||||
|
|
||||||
return markdown
|
return markdown
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue