Add Slug Generator

This commit is contained in:
Dan Jones 2025-03-13 16:58:55 -05:00
commit 1d235af876
8 changed files with 124 additions and 1 deletions

View file

@ -90,3 +90,19 @@ func ExampleIncrementalWithStartAndStep() {
// foo_44.txt
// foo_46.txt
}
func ExampleSlug() {
conf := NewConfig(WithGenerator(Slug()), WithOriginal("My name is Jimmy"))
str, _ := Make(conf)
fmt.Println(str)
// Output: my-name-is-jimmy.txt
}
func ExampleSlugWithLang() {
conf := NewConfig(WithGenerator(SlugWithLang("de")), WithOriginal("Diese & Dass"))
str, _ := Make(conf)
fmt.Println(str)
// Output: diese-und-dass.txt
}