aboutsummaryrefslogtreecommitdiff
path: root/docs/api
diff options
context:
space:
mode:
authorShinigami <[email protected]>2022-09-10 01:59:47 +0800
committerGitHub <[email protected]>2022-09-09 13:59:47 -0400
commit4efa530e5924e78712c220c9b4f4a0cf41cb5167 (patch)
tree362fe26e917b7de2171f9f7d4c8a1685a3430869 /docs/api
parent0c6e9b16548614dc0ce91296e3885c9e421e4e99 (diff)
downloadfaker-4efa530e5924e78712c220c9b4f4a0cf41cb5167.tar.xz
faker-4efa530e5924e78712c220c9b4f4a0cf41cb5167.zip
docs: fix @see links (#1363)
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/ApiIndex.vue18
1 files changed, 1 insertions, 17 deletions
diff --git a/docs/api/ApiIndex.vue b/docs/api/ApiIndex.vue
index ec9c752e..882c4a69 100644
--- a/docs/api/ApiIndex.vue
+++ b/docs/api/ApiIndex.vue
@@ -2,6 +2,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
+import { slugify } from '../.vitepress/shared/utils/slugify';
import apiSearchIndex from './api-search-index.json';
import { APIGroup } from './api-types';
@@ -42,23 +43,6 @@ const filtered = computed(() => {
})
.filter((i) => i) as APIGroup[];
});
-
-// same as vitepress' slugify logic
-function slugify(text: string): string {
- return (
- text
- // Replace special characters
- .replace(/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'<>,.?/]+/g, '-')
- // Remove continuous separators
- .replace(/\-{2,}/g, '-')
- // Remove prefixing and trailing separators
- .replace(/^\-+|\-+$/g, '')
- // ensure it doesn't start with a number (like #123)
- .replace(/^(\d)/, '_$1')
- // lowercase
- .toLowerCase()
- );
-}
</script>
<template>