feat: Indicate dependency source

Dependencies might reside in the AUR or official repositories.
Add "AUR" as superscript letters to indicate if a package/provider
is present in the AUR.

Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
moson 2023-09-03 14:17:11 +02:00
parent 1433553c05
commit 0a7b02956f
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
5 changed files with 72 additions and 7 deletions

View file

@ -83,9 +83,11 @@ def package_link(package: Union[Package, OfficialProvider]) -> str:
@register_filter("provides_markup")
def provides_markup(provides: Providers) -> str:
return ", ".join(
[f'<a href="{package_link(pkg)}">{pkg.Name}</a>' for pkg in provides]
)
links = []
for pkg in provides:
aur = "ᴬᵁᴿ" if not pkg.is_official else ""
links.append(f'<a href="{package_link(pkg)}">{pkg.Name}</a>{aur}')
return ", ".join(links)
def get_pkg_or_base(