Documentation ¶
Overview ¶
Package slugify generate slug from unicode string, check Format() for details. Example:
package main import ( "fmt" "github.com/owarai/slugify" ) func main() { text := slugify.Format("hello, 你好,world! 世界!", true) fmt.Println(text) // Will print: "hello-你好-world-世界" someText := slugify.Format("hello, 你好,world! 世界!", false) fmt.Println(someText) // Will print: "hello-world" }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format slugify the input(must be valid utf8 string), convert to ASCII if 'allowUnicode' is false(non-ascii character will be removed in this situation). Convert spaces or repeated dashes to single dashes. Remove characters that aren't letters, punctuations or separators. Convert to lowercase and replace other(may repeated) punctuations or separators to single dash.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.