Adds ellipses after each listing, linking to full report

This commit is contained in:
Alicia Sykes 2024-03-29 14:05:47 +00:00
parent 64d67a50fa
commit 6a59c9d1f1
1 changed files with 12 additions and 3 deletions

View File

@ -54,11 +54,18 @@ def statsElement(isOpenSource, isSecurityAudited, isAcceptsCrypto):
statsStr += "💰 Accepts Anonymous Payment " statsStr += "💰 Accepts Anonymous Payment "
return statsStr return statsStr
def slugify(title):
if not title:
return ''
title = title.lower()
title = re.sub(r'\s+', '-', title)
title = re.sub(r'\+|&', 'and', title)
title = title.replace('?', '')
return title
def awesomePrivacyReport(categoryName, sectionName, serviceName): def awesomePrivacyReport(categoryName, sectionName, serviceName):
if not serviceName: if not serviceName:
return "" return ""
def slugify(name):
return (name or '').lower().replace(' ', '-')
return ( return (
f"[![{serviceName} on Awesome Privacy]" f"[![{serviceName} on Awesome Privacy]"
f"(https://img.shields.io/badge/View%20Report-FC60A8?style=flat&logo=awesomelists&label={serviceName.replace(' ', '_')})]" f"(https://img.shields.io/badge/View%20Report-FC60A8?style=flat&logo=awesomelists&label={serviceName.replace(' ', '_')})]"
@ -111,7 +118,9 @@ def makeAwesomePrivacy():
for app in section.get('services') or []: for app in section.get('services') or []:
markdown += ( markdown += (
f"- **[{iconElement(app.get('url'), app.get('icon'))} {app.get('name')}]" f"- **[{iconElement(app.get('url'), app.get('icon'))} {app.get('name')}]"
f"({app.get('url')})** - {app.get('description')} " f"({app.get('url')})** - {app.get('description')}"
f"[…](https://awesome-privacy.xyz/"
f"{slugify(category.get('name'))}/{slugify(section.get('name'))}/{slugify(app.get('name'))} \"View full {app.get('name')} report\") \n"
+ (( + ((
f"\t- <details>\n\t\t<summary>Stats</summary>\n\n\t\t" f"\t- <details>\n\t\t<summary>Stats</summary>\n\n\t\t"
f"{repoElement(app.get('github'))} " f"{repoElement(app.get('github'))} "