|
| 1 | +/* eslint-disable @typescript-eslint/no-var-requires */ |
1 | 2 | /* eslint-disable @typescript-eslint/no-unused-vars */ |
2 | 3 | const { ReflectionKind } = require('typedoc'); |
3 | 4 | const { writeFile, readdir, unlink } = require('fs/promises'); |
@@ -87,6 +88,21 @@ ${parseLinks(remarks.text)} |
87 | 88 | `; |
88 | 89 | } |
89 | 90 |
|
| 91 | +/** |
| 92 | + * |
| 93 | + * @param {import('typedoc').JSONOutput.CommentTag} remarks |
| 94 | + */ |
| 95 | +function extractDeprecated(deprecated) { |
| 96 | + return ` |
| 97 | +:::warning Deprecated |
| 98 | +
|
| 99 | +This feature will be removed in the next major release. |
| 100 | +${parseLinks(deprecated.text)} |
| 101 | +
|
| 102 | +::: |
| 103 | +`; |
| 104 | +} |
| 105 | + |
90 | 106 | /** |
91 | 107 | * |
92 | 108 | * @param {import('typedoc').JSONOutput.CommentTag} warnings |
@@ -136,9 +152,13 @@ function extractAdmonitions(comment, isHeader) { |
136 | 152 | const remarks = comment.tags && comment.tags.find((t) => t.tag === 'remarks'); |
137 | 153 | const warning = comment.tags && comment.tags.find((t) => t.tag === 'warning'); |
138 | 154 | const example = comment.tags && comment.tags.find((t) => t.tag === 'example'); |
139 | | - return `\n${remarks ? extractRemarks(remarks) : ''}${ |
140 | | - warning ? extractWarning(warning) : '' |
141 | | - }${example ? extractExample(example, isHeader) : ''}\n\n`; |
| 155 | + const deprecated = |
| 156 | + comment.tags && comment.tags.find((t) => t.tag === 'deprecated'); |
| 157 | + return `\n${deprecated ? extractDeprecated(deprecated) : ''}${ |
| 158 | + remarks ? extractRemarks(remarks) : '' |
| 159 | + }${warning ? extractWarning(warning) : ''}${ |
| 160 | + example ? extractExample(example, isHeader) : '' |
| 161 | + }\n\n`; |
142 | 162 | } |
143 | 163 |
|
144 | 164 | /** |
|
0 commit comments