gitmyhub

github-readme-crisp-links

Python ★ 34 updated 1mo ago

🌈 Cleaner GitHub README link text. CLI + web app.

CLI and web app that generate SVG text wrapped in a markdown link, removing the underline GitHub adds under README links.

PythonPillowfontToolsSVGsetup: easycomplexity 1/5

GitHub puts an underline under any link that contains text in a README. That underline is fine in body copy, but it can make a project list look busy when each entry already shows an icon, a name, and a short description. GitHub strips the usual tricks people try in order to turn the underline off: inline style attributes, font tags, and style blocks at the top of the file. The author of this small Python tool found that one thing GitHub does not strip is a link whose only contents are an image. With no text inside the link, there is nothing for the underline rule to paint, and the line goes away.

This project is a CLI, plus a small browser app on GitHub Pages, that automates the workaround. You give it a project name and a color, and it writes an SVG that renders that name in your chosen color, then prints the matching markdown snippet that wraps the SVG in a link. You paste the snippet into your README and the underline is gone. The CLI measures the width of the text against Helvetica Bold using Pillow so the SVG canvas fits the glyphs without clipping. Pillow is the only dependency, and the project says it has been tested on Python 3.8 and above.

The tool also supports gradients. You can pick a preset such as rainbow, sunset, ocean, mint, candy, or dusk, or you can pass a list of hex codes. For gradients the tool bakes the letter shapes into the SVG as path data using fontTools, then applies the gradient as a fill, which avoids the blurry edges that browsers produce when filling small text with a gradient. Solid colors stay as text elements because the system text renderer is sharper for single colors.

A batch mode reads a JSON file with one item per project, so a long list of links can be rendered in one run. The README also covers two practical issues: GitHub caches SVGs through its image proxy for a long time, so you may need a version query string or a renamed file after an update, and a single SVG only carries one color, so for separate light and dark mode colors you generate two SVGs and reference them with a picture element.

Where it fits