Skip to content

Commit 832cfdf

Browse files
authored
Add more info to readme (#62)
1 parent a6b6b19 commit 832cfdf

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# slug
22

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

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

46-
### Requests or bugs?
46+
## Design
47+
48+
This library will always returns clean output from any Unicode string
49+
containing only the following ASCII characters:
50+
51+
* numbers: `0-9`
52+
* small letters: `a-z`
53+
* big letters: `A-Z` (only if you set `Lowercase` to `false`)
54+
* minus sign: `-`
55+
* underscore: `_`
56+
57+
Minus sign and underscore characters will never appear at the beginning or
58+
the end of the returned string.
59+
60+
Thanks to context-insensitive transliteration of Unicode characters to ASCII
61+
output returned string is safe for URL slugs and filenames.
62+
63+
## Requests or bugs?
4764

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

67+
If your language is missing you could add it in `languages_substitution.go`
68+
file.
69+
70+
In case of missing proper Unicode characters transliteration to ASCII you could
71+
add them to underlying library:
72+
<https://github.com/gosimple/unidecode>.
73+
5074
## Installation
5175

5276
```shell

0 commit comments

Comments
 (0)