diff options
| author | Matt Mayer <[email protected]> | 2023-03-29 20:36:46 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-29 13:36:46 +0000 |
| commit | 3562e872530b3610d95be71aa6f4f7fdfef7134f (patch) | |
| tree | c6ba28a9f3cf30e5bf5c0a935fead6bdb2668531 /scripts | |
| parent | 88e561a5490003a41665eb007c5c28ff0800ae09 (diff) | |
| download | faker-3562e872530b3610d95be71aa6f4f7fdfef7134f.tar.xz faker-3562e872530b3610d95be71aa6f4f7fdfef7134f.zip | |
docs: add overview guides to specific modules (#1929)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/apidoc/moduleMethods.ts | 4 | ||||
| -rw-r--r-- | scripts/apidoc/signature.ts | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/scripts/apidoc/moduleMethods.ts b/scripts/apidoc/moduleMethods.ts index b89e873c..cdd9222e 100644 --- a/scripts/apidoc/moduleMethods.ts +++ b/scripts/apidoc/moduleMethods.ts @@ -1,7 +1,7 @@ import type { DeclarationReflection, ProjectReflection } from 'typedoc'; import type { Method } from '../../docs/.vitepress/components/api-docs/method'; import { writeApiDocsData, writeApiDocsModulePage } from './apiDocsWriter'; -import { analyzeSignature, toBlock } from './signature'; +import { analyzeSignature, stripAbsoluteFakerUrls, toBlock } from './signature'; import { extractModuleFieldName, extractModuleName, @@ -40,7 +40,7 @@ function processModuleMethod(module: DeclarationReflection): PageAndDiffIndex { const moduleName = extractModuleName(module); const moduleFieldName = extractModuleFieldName(module); console.log(`Processing Module ${moduleName}`); - const comment = toBlock(module.comment); + const comment = stripAbsoluteFakerUrls(toBlock(module.comment)); const methods: Method[] = []; diff --git a/scripts/apidoc/signature.ts b/scripts/apidoc/signature.ts index c41b758c..b3bd4523 100644 --- a/scripts/apidoc/signature.ts +++ b/scripts/apidoc/signature.ts @@ -44,6 +44,10 @@ export function toBlock(comment?: Comment): string { return joinTagParts(comment?.summary) || 'Missing'; } +export function stripAbsoluteFakerUrls(markdown: string): string { + return markdown.replace(/https:\/\/(next.)?fakerjs.dev\//g, '/'); +} + let markdown: MarkdownRenderer; export async function initMarkdownRenderer(): Promise<void> { |
