Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more info to readme #62

Merged
merged 1 commit into from
Nov 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# slug

Package `slug` generate slug from unicode string, URL-friendly slugify with
Package `slug` generate slug from Unicode string, URL-friendly slugify with
multiple languages support.

[![Go Reference](https://pkg.go.dev/badge/github.com/gosimple/slug.svg)](https://pkg.go.dev/github.com/gosimple/slug)
Expand Down Expand Up @@ -43,10 +43,34 @@ func main() {
}
```

### Requests or bugs?
## Design

This library will always returns clean output from any Unicode string
containing only the following ASCII characters:

* numbers: `0-9`
* small letters: `a-z`
* big letters: `A-Z` (only if you set `Lowercase` to `false`)
* minus sign: `-`
* underscore: `_`

Minus sign and underscore characters will never appear at the beginning or
the end of the returned string.

Thanks to context-insensitive transliteration of Unicode characters to ASCII
output returned string is safe for URL slugs and filenames.

## Requests or bugs?

<https://github.com/gosimple/slug/issues>

If your language is missing you could add it in `languages_substitution.go`
file.

In case of missing proper Unicode characters transliteration to ASCII you could
add them to underlying library:
<https://github.com/gosimple/unidecode>.

## Installation

```shell
Expand Down