CLI & text · real, tested code

Generate a URL-Safe Slug from Text in Larzscript

Turn an arbitrary title into a clean, URL-safe slug - accented characters transliterated, not just stripped.

slugify.slug() lowercases, collapses non-alphanumeric runs into a separator and trims the edges; unique_slug() appends -2/-3/... until the result isn't already taken.

larzscript pkg install slugify

Code

import "slugify" as slugify

print(slugify.slug("What Is Larzscript? A Guide"))
print(slugify.slug("café résumé"))
print(slugify.unique_slug("Hello", ["hello", "hello-2"]))
Output
what-is-larzscript-a-guide
cafe-resume
hello-3