docs: move gendocs tool to dagger/dagger
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
11
tools/gendocs/src/@rocketseat/gatsby-theme-docs/util/slug.js
Normal file
11
tools/gendocs/src/@rocketseat/gatsby-theme-docs/util/slug.js
Normal file
@@ -0,0 +1,11 @@
|
||||
export default function slugify(string) {
|
||||
return string
|
||||
.toString() // Cast to string
|
||||
.toLowerCase() // Convert the string to lowercase letters
|
||||
.trim() // Remove whitespace from both sides of a string
|
||||
.replace(/\s/g, '-') // Replace each space with -
|
||||
.replace(
|
||||
/[^\w\-\u00b4\u00C0-\u00C3\u00c7\u00C9-\u00CA\u00CD\u00D3-\u00D5\u00DA\u00E0-\u00E3\u00E7\u00E9-\u00EA\u00ED\u00F3-\u00F5\u00FA]+/g,
|
||||
'',
|
||||
); // Removes all chars that aren't words, -, ´ or some latin characters (À Á Â Ã Ç É Ê Í Ó Ô Õ Ú à á â ã ç é ê í ó ô õ ú)
|
||||
}
|
Reference in New Issue
Block a user