aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinigami <[email protected]>2022-09-09 17:47:23 +0800
committerGitHub <[email protected]>2022-09-09 11:47:23 +0200
commit83b61429fa710903e4a82fe655a6c196deb16fbd (patch)
treed2080a48849302e6786f3d270dfa50bf9e71e84d
parent5ae93a7f51d48b2f2f4999f5cfbd2b4a4a5bb272 (diff)
downloadfaker-83b61429fa710903e4a82fe655a6c196deb16fbd.tar.xz
faker-83b61429fa710903e4a82fe655a6c196deb16fbd.zip
docs: fix api search (#1361)
-rw-r--r--docs/api/ApiIndex.vue6
-rw-r--r--scripts/apidoc/apiDocsWriter.ts5
2 files changed, 6 insertions, 5 deletions
diff --git a/docs/api/ApiIndex.vue b/docs/api/ApiIndex.vue
index 0846d9f2..ec9c752e 100644
--- a/docs/api/ApiIndex.vue
+++ b/docs/api/ApiIndex.vue
@@ -55,8 +55,8 @@ function slugify(text: string): string {
.replace(/^\-+|\-+$/g, '')
// ensure it doesn't start with a number (like #123)
.replace(/^(\d)/, '_$1')
- // // lowercase
- // .toLowerCase()
+ // lowercase
+ .toLowerCase()
);
}
</script>
@@ -84,7 +84,7 @@ function slugify(text: string): string {
<ul>
<li v-for="h of item.headers" :key="h.anchor">
<a :href="item.link + '.html#' + slugify(h.anchor)">{{
- h.anchor
+ h.text
}}</a>
</li>
</ul>
diff --git a/scripts/apidoc/apiDocsWriter.ts b/scripts/apidoc/apiDocsWriter.ts
index 99193242..42b8f6c4 100644
--- a/scripts/apidoc/apiDocsWriter.ts
+++ b/scripts/apidoc/apiDocsWriter.ts
@@ -167,9 +167,10 @@ export function writeApiSearchIndex(project: ProjectReflection): void {
moduleApiSection.items = [...apiModules, ...directMethods]
.map((module) => {
+ const moduleName = extractModuleName(module);
const apiSection: APIItem = {
- text: extractModuleName(module),
- link: module.name.toLowerCase(),
+ text: moduleName,
+ link: moduleName.toLowerCase(),
headers: [],
};
if (module.kind !== ReflectionKind.Property) {