diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-25 00:47:47 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-25 00:47:47 +0200 |
| commit | c6cc0108ca7738023b45e0eeac0fa2390532dd93 (patch) | |
| tree | 36890e6cd3091bbab8efbe686cc56f467f645bfd /vendor/github.com/gosimple/slug/doc.go | |
| parent | 0130404a1dc663d4aa68d780c9bcb23a4243e68d (diff) | |
| download | jbmafp-c6cc0108ca7738023b45e0eeac0fa2390532dd93.tar.gz | |
Diffstat (limited to 'vendor/github.com/gosimple/slug/doc.go')
| -rw-r--r-- | vendor/github.com/gosimple/slug/doc.go | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/github.com/gosimple/slug/doc.go b/vendor/github.com/gosimple/slug/doc.go new file mode 100644 index 0000000..f6f764e --- /dev/null +++ b/vendor/github.com/gosimple/slug/doc.go | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | // Copyright 2013 by Dobrosław Żybort. All rights reserved. | ||
| 2 | // This Source Code Form is subject to the terms of the Mozilla Public | ||
| 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| 4 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| 5 | |||
| 6 | /* | ||
| 7 | Package slug generate slug from unicode string, URL-friendly slugify with | ||
| 8 | multiple languages support. | ||
| 9 | |||
| 10 | Example: | ||
| 11 | |||
| 12 | package main | ||
| 13 | |||
| 14 | import( | ||
| 15 | "github.com/gosimple/slug" | ||
| 16 | "fmt" | ||
| 17 | ) | ||
| 18 | |||
| 19 | func main () { | ||
| 20 | text := slug.Make("Hellö Wörld хелло ворлд") | ||
| 21 | fmt.Println(text) // Will print: "hello-world-khello-vorld" | ||
| 22 | |||
| 23 | someText := slug.Make("影師") | ||
| 24 | fmt.Println(someText) // Will print: "ying-shi" | ||
| 25 | |||
| 26 | enText := slug.MakeLang("This & that", "en") | ||
| 27 | fmt.Println(enText) // Will print: "this-and-that" | ||
| 28 | |||
| 29 | deText := slug.MakeLang("Diese & Dass", "de") | ||
| 30 | fmt.Println(deText) // Will print: "diese-und-dass" | ||
| 31 | |||
| 32 | slug.Lowercase = false // Keep uppercase characters | ||
| 33 | deUppercaseText := slug.MakeLang("Diese & Dass", "de") | ||
| 34 | fmt.Println(deUppercaseText) // Will print: "Diese-und-Dass" | ||
| 35 | |||
| 36 | slug.CustomSub = map[string]string{ | ||
| 37 | "water": "sand", | ||
| 38 | } | ||
| 39 | textSub := slug.Make("water is hot") | ||
| 40 | fmt.Println(textSub) // Will print: "sand-is-hot" | ||
| 41 | } | ||
| 42 | |||
| 43 | Requests or bugs? | ||
| 44 | |||
| 45 | https://github.com/gosimple/slug/issues | ||
| 46 | */ | ||
| 47 | package slug | ||
