diff options
| author | ST-DDT <[email protected]> | 2023-04-01 14:46:36 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-01 12:46:36 +0000 |
| commit | f9411c90d02e8f716283c30accca022eb5e68031 (patch) | |
| tree | f9fed1886d748a7e99fd13d6c41e1bfb25410add /scripts | |
| parent | c5eb72c7dbc03f1258062048aa0e1270719fd9e3 (diff) | |
| download | faker-f9411c90d02e8f716283c30accca022eb5e68031.tar.xz faker-f9411c90d02e8f716283c30accca022eb5e68031.zip | |
docs: mark deprecated modules (#2000)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/apidoc/apiDocsWriter.ts | 11 | ||||
| -rw-r--r-- | scripts/apidoc/moduleMethods.ts | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/scripts/apidoc/apiDocsWriter.ts b/scripts/apidoc/apiDocsWriter.ts index 146c7923..6f00f64a 100644 --- a/scripts/apidoc/apiDocsWriter.ts +++ b/scripts/apidoc/apiDocsWriter.ts @@ -41,6 +41,7 @@ export function writeApiDocsModulePage( moduleName: string, lowerModuleName: string, comment: string, + deprecated: string | undefined, methods: Method[] ): void { // Write api docs page @@ -57,6 +58,16 @@ export function writeApiDocsModulePage( ::: v-pre + ${ + deprecated == null + ? '' + : `<div class="warning custom-block"> + <p class="custom-block-title">Deprecated</p> + <p>This module is deprecated and will be removed in a future version.</p> + <span>${deprecated}</span> + </div>` + } + ${comment} ::: diff --git a/scripts/apidoc/moduleMethods.ts b/scripts/apidoc/moduleMethods.ts index cdd9222e..20cbc2b8 100644 --- a/scripts/apidoc/moduleMethods.ts +++ b/scripts/apidoc/moduleMethods.ts @@ -3,6 +3,7 @@ import type { Method } from '../../docs/.vitepress/components/api-docs/method'; import { writeApiDocsData, writeApiDocsModulePage } from './apiDocsWriter'; import { analyzeSignature, stripAbsoluteFakerUrls, toBlock } from './signature'; import { + extractDeprecated, extractModuleFieldName, extractModuleName, selectApiMethodSignatures, @@ -41,7 +42,7 @@ function processModuleMethod(module: DeclarationReflection): PageAndDiffIndex { const moduleFieldName = extractModuleFieldName(module); console.log(`Processing Module ${moduleName}`); const comment = stripAbsoluteFakerUrls(toBlock(module.comment)); - + const deprecated = extractDeprecated(module); const methods: Method[] = []; // Generate method section @@ -52,7 +53,13 @@ function processModuleMethod(module: DeclarationReflection): PageAndDiffIndex { methods.push(analyzeSignature(signature, moduleFieldName, methodName)); } - writeApiDocsModulePage(moduleName, moduleFieldName, comment, methods); + writeApiDocsModulePage( + moduleName, + moduleFieldName, + comment, + deprecated, + methods + ); writeApiDocsData(moduleFieldName, methods); return [ |
