https://github.com/james2doyle/lit-slugify
Lit package for generating URL slugs
https://github.com/james2doyle/lit-slugify
Last synced: 8 months ago
JSON representation
Lit package for generating URL slugs
- Host: GitHub
- URL: https://github.com/james2doyle/lit-slugify
- Owner: james2doyle
- License: mit
- Created: 2015-04-06T21:18:49.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-05T20:12:31.000Z (almost 11 years ago)
- Last Synced: 2025-06-04T23:30:25.698Z (about 1 year ago)
- Language: Lua
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Slugify
=======
This was inspired by [simov/slugify](https://github.com/simov/slugify).
### Install
```sh
$ lit install james2doyle/slugify
```
### Usage
Input:
```lua
local slugify = require('slugify')
print(slugify("this is suppoSED to BE a nice URL"))
-- use _ instead of the default -
print(slugify("this is suppoSED __ to BE a nice URL", '_'))
print(slugify("You can find details! about the string library in section 5.4"))
-- insane url attempt
print(slugify("yayΩ≈ç√∫˜µåß∂ƒ©˙∆˚åß∂∂ƒ©©˙∆˚œ∑´®†¥¨ˆøπ…æ“‘[]{}"))
```
Output:
```
this-is-supposed-to-be-a-nice-url
this_is_supposed_to_be_a_nice_url
you-can-find-details-about-the-string-library-in-section-5-4
yay
```