From 3cfeb3814703d12a9e95ed684fc2c8f94d1f2c72 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Fri, 28 Apr 2023 15:23:50 +0200 Subject: docs: fix full url to absolute conversion (#2101) --- scripts/apidoc/moduleMethods.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'scripts/apidoc/moduleMethods.ts') diff --git a/scripts/apidoc/moduleMethods.ts b/scripts/apidoc/moduleMethods.ts index 55b1869f..65a62528 100644 --- a/scripts/apidoc/moduleMethods.ts +++ b/scripts/apidoc/moduleMethods.ts @@ -15,6 +15,7 @@ import { selectApiModules, } from './typedoc'; import type { ModuleSummary } from './utils'; +import { adjustUrls } from './utils'; /** * Analyzes and writes the documentation for modules and their methods such as `faker.animal.cat()`. @@ -34,10 +35,9 @@ export function processModules(project: ProjectReflection): ModuleSummary[] { */ function processModule(module: DeclarationReflection): ModuleSummary { const moduleName = extractModuleName(module); - const moduleFieldName = extractModuleFieldName(module); console.log(`Processing Module ${moduleName}`); - const comment = extractDescription(module); - const deprecated = extractDeprecated(module); + const moduleFieldName = extractModuleFieldName(module); + const { comment, deprecated } = analyzeModule(module); const methods = processModuleMethods(module, `faker.${moduleFieldName}.`); return writeApiDocsModule( @@ -49,6 +49,22 @@ function processModule(module: DeclarationReflection): ModuleSummary { ); } +/** + * Analyzes the documentation for a class. + * + * @param module The class to process. + * @returns The class information. + */ +export function analyzeModule(module: DeclarationReflection): { + comment: string; + deprecated: string | undefined; +} { + return { + comment: adjustUrls(extractDescription(module)), + deprecated: extractDeprecated(module), + }; +} + /** * Processes all api methods of the given class. This does not include the constructor. * -- cgit v1.2.3