{"id":13804663,"url":"https://github.com/EuAndreh/cl-slug","last_synced_at":"2025-05-13T17:32:54.076Z","repository":{"id":25081279,"uuid":"28501800","full_name":"EuAndreh/cl-slug","owner":"EuAndreh","description":"Small library to make slugs, mainly for URIs, from english and beyond.","archived":true,"fork":false,"pushed_at":"2017-05-05T04:41:49.000Z","size":122,"stargazers_count":25,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-04T01:03:54.204Z","etag":null,"topics":["common-lisp","quicklisp","roswell"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EuAndreh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-26T06:16:21.000Z","updated_at":"2024-07-01T11:53:58.000Z","dependencies_parsed_at":"2022-09-09T21:32:44.876Z","dependency_job_id":null,"html_url":"https://github.com/EuAndreh/cl-slug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuAndreh%2Fcl-slug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuAndreh%2Fcl-slug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuAndreh%2Fcl-slug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuAndreh%2Fcl-slug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EuAndreh","download_url":"https://codeload.github.com/EuAndreh/cl-slug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225247935,"owners_count":17444144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["common-lisp","quicklisp","roswell"],"created_at":"2024-08-04T01:00:52.198Z","updated_at":"2024-11-18T20:32:18.861Z","avatar_url":"https://github.com/EuAndreh.png","language":"Common Lisp","funding_links":[],"categories":["REPLs ##"],"sub_categories":[],"readme":"# cl-slug\n[![Quicklisp](http://quickdocs.org/badge/cl-slug.svg)](http://quickdocs.org/cl-slug/)\n[![Build Status](https://travis-ci.org/EuAndreh/cl-slug.svg?branch=master)](https://travis-ci.org/EuAndreh/cl-slug)\n[![Circle CI](https://circleci.com/gh/EuAndreh/cl-slug.svg?style=svg)](https://circleci.com/gh/EuAndreh/cl-slug)\n[![Coverage Status](https://coveralls.io/repos/EuAndreh/cl-slug/badge.svg?branch=master)](https://coveralls.io/r/EuAndreh/cl-slug?branch=master)\n\nEasily create slugs from any string. Supports many languages alphabets. See [Supported languages](#supported-languages) to check for supported languages or to help to add one.\n\nInspired by [Lisp Web Tales](http://lispwebtales.ppenev.com/chap05.html#leanpub-auto-rewriting-the-routes).\n\n## Usage\n```lisp\n* (ql:quickload :cl-slug)\n; =\u003e (:CL-SLUG)\n* (import '(slug:slugify slug:asciify slug:CamelCaseFy))\n; =\u003e T\n```\n\nThe main function is called `slugify`:\n\n```lisp\n* (slugify \"My new cool article, for the blog (V. 2).\")\n; =\u003e \"my-new-cool-article-for-the-blog-v-2\"\n* (slugify \"André Miranda\")\n; =\u003e \"andre-miranda\"\n```\n\n`slugify` removes any accented character, replacing it with an unaccented equivalent, and any punctuation (a punctuation is a char that returns `NIL` for `alphanumericp`) and puts a dash (`-`) on it's place. You can change that by binding (of `setf`ing) `*slug-separator*`:\n\n```lisp\n* (let ((*slug-separator* #\\_))\n    (slugify \"Testing the *slug-separator* var...\"))\n; =\u003e \"testing_the_slug_separator_var\"\n```\n\n`slugify` also ignores numbers:\n\n```lisp\n* (slugify \"one2three4five\")\n; =\u003e \"one2three4five\"\n```\n\nIf you just want to remove accents and punctuation of a given string, use `asciify`:\n\n```lisp\n* (asciify \"Eu André!\")\n; =\u003e \"Eu Andre!\"\n```\n\nOr if you want a CamelCase, use `CamelCaseFy`:\n\n```lisp\n* (CamelCaseFy \"My new camel case string\")\n; =\u003e \"MyNewCamelCaseString\"\n```\n\nAvailable languages are stored in `*available-languages*`:\n```lisp\n* slug:*available-languages*\n((:TR . \"Türkçe (Turkish)\") (:SV . \"Svenska (Swedish)\") (:FI . \"Suomi (Finnish)\") \n (:UK . \"українська (Ukrainian)\") (:RU . \"Ру́сский (Russian)\") (:RO . \"Română (Romanian)\")\n (:RM . \"Rumàntsch (Romansh)\") (:PT . \"Português (Portuguese)\") (:PL . \"Polski (Polish)\")\n (:NO . \"Norsk (Norwegian)\") (:LT . \"Lietuvių (Lithuanian)\") (:LV . \"Latviešu (Latvian)\")\n (:LA . \"Lingua Latīna (Latin)\") (:IT . \"Italiano (Italian)\") (:EL . \"ελληνικά (Greek)\")\n (:FR . \"Français (French)\") (:EO . \"Esperanto\") (:ES . \"Español (Spanish)\") (:EN . \"English\")\n (:DE . \"Deutsch (German)\") (:DA . \"Dansk (Danish)\") (:CS . \"Čeština (Czech)\")\n (:CURRENCY . \"Currency\"))\n```\n\n## Dependencies\n\nThis library depends on [CL-PPCRE](http://weitz.de/cl-ppcre). The test package uses the [prove](https://github.com/fukamachi/prove) test library.\n\n## Installation\nAvailable on [Quicklisp](http://quicklisp.org):\n```\n(ql:quickload :cl-slug)\n```\n\n## Supported languages\nThe languages that are supported right now are:\n- english\n- portuguese\n- esperanto\n- german\n- french\n- swedish\n- finnish\n- norwegian\n- danish\n- italian\n- spanish\n- romansh\n\nPorted from [Django](https://code.djangoproject.com/browser/django/trunk/django/contrib/admin/media/js/urlify.js)():\n- currency\n- romanian\n- lithuanian\n- latvian\n- polish\n- czesh\n- ukranian\n- russian\n- turkish\n- greek\n- latin\n\nAt the present moment, adding new languages is a fairly manual process:\n  1. Identify non-ASCII characters in a given language's alphabet\n  2. Establish equivalence between the found characters and ASCII characters\n  3. Write them down in the code.\n\nAll those things can actually be done for most of the dominant Western languages, but can't be applied for minor regional languages or many other non-Latin languages from the whole world, like Chinese. It's not generic and not scalable.\n\nI couldn't think of a solution so far for this, but if you know a solution (even a partial one) I'd be glad to hear =].\n\n## Bugs\nIf you find any bug or inconsistency in the code, or if you find it too hard to use, please, feel free to open an issue.\n\n## Tests\nThis library is tested under [ABCL](https://common-lisp.net/project/armedbear/), [SBCL](http://www.sbcl.org/), [CCL](http://ccl.clozure.com/), [CLISP](http://www.clisp.org/) and [ECL](https://common-lisp.net/project/ecl/) Common Lisp implementations.\n\nTo run all the defined tests, use:\n```lisp\n* (asdf:test-system :cl-slug)\n; prints lots of (colorful) stuff...\n; =\u003e T\n```\n\nTests are ran with [Travis CI](https://travis-ci.org/EuAndreh/cl-slug) and [Circle CI](https://circleci.com/gh/EuAndreh/cl-slug) using [cl-travis](https://github.com/luismbo/cl-travis), [CIM](https://github.com/KeenS/CIM), [cl-coveralls](https://github.com/fukamachi/cl-coveralls) and [Roswell](https://github.com/snmsts/roswell). Check it out!\n\n## Author\nAndré Miranda.\n\n## License\n[LLGPL](https://tldrlegal.com/license/lisp-lesser-general-public-license#fulltext).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEuAndreh%2Fcl-slug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEuAndreh%2Fcl-slug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEuAndreh%2Fcl-slug/lists"}