Commit 6a59c9d1f1
Unsigned
Layout: unified · split
lib/awesome-privacy-readme-gen.py +12 −3
| @@ -54,11 +54,18 @@ def statsElement(isOpenSource, isSecurityAudited, isAcceptsCrypto): | ||
| 54 | 54 | statsStr += "💰 Accepts Anonymous Payment " |
| 55 | 55 | return statsStr |
| 56 | 56 | |
| 57 | def slugify(title): | |
| 58 | if not title: | |
| 59 | return '' | |
| 60 | title = title.lower() | |
| 61 | title = re.sub(r'\s+', '-', title) | |
| 62 | title = re.sub(r'\+|&', 'and', title) | |
| 63 | title = title.replace('?', '') | |
| 64 | return title | |
| 65 | ||
| 57 | 66 | def awesomePrivacyReport(categoryName, sectionName, serviceName): |
| 58 | 67 | if not serviceName: |
| 59 | 68 | return "" |
| 60 | def slugify(name): | |
| 61 | return (name or '').lower().replace(' ', '-') | |
| 62 | 69 | return ( |
| 63 | 70 | f"[![{serviceName} on Awesome Privacy]" |
| 64 | 71 | f"(https://img.shields.io/badge/View%20Report-FC60A8?style=flat&logo=awesomelists&label={serviceName.replace(' ', '_')})]" |
| @@ -111,7 +118,9 @@ def makeAwesomePrivacy(): | ||
| 111 | 118 | for app in section.get('services') or []: |
| 112 | 119 | markdown += ( |
| 113 | 120 | f"- **[{iconElement(app.get('url'), app.get('icon'))} {app.get('name')}]" |
| 114 | f"({app.get('url')})** - {app.get('description')} " | |
| 121 | f"({app.get('url')})** - {app.get('description')}" | |
| 122 | f"[…](https://awesome-privacy.xyz/" | |
| 123 | f"{slugify(category.get('name'))}/{slugify(section.get('name'))}/{slugify(app.get('name'))} \"View full {app.get('name')} report\") \n" | |
| 115 | 124 | + (( |
| 116 | 125 | f"\t- <details>\n\t\t<summary>Stats</summary>\n\n\t\t" |
| 117 | 126 | f"{repoElement(app.get('github'))} " |