@@ -19,7 +19,8 @@ import {
1919 DocCodeSpan ,
2020 DocFencedCode ,
2121 StandardTags ,
22- DocBlock
22+ DocBlock ,
23+ DocComment
2324} from '@microsoft/tsdoc' ;
2425import {
2526 ApiModel ,
@@ -117,8 +118,27 @@ export class MarkdownDocumenter {
117118 }
118119
119120 if ( apiItem instanceof ApiDocumentedItem ) {
120- if ( apiItem . tsdocComment ) {
121- this . _appendSection ( output , apiItem . tsdocComment . summarySection ) ;
121+ const tsdocComment : DocComment | undefined = apiItem . tsdocComment ;
122+
123+ if ( tsdocComment ) {
124+
125+ if ( tsdocComment . deprecatedBlock ) {
126+ output . appendNode (
127+ new DocNoteBox ( { configuration : this . _tsdocConfiguration } ,
128+ [
129+ new DocParagraph ( { configuration : this . _tsdocConfiguration } , [
130+ new DocPlainText ( {
131+ configuration : this . _tsdocConfiguration ,
132+ text : 'Warning: This API is now obsolete. '
133+ } )
134+ ] ) ,
135+ ...tsdocComment . deprecatedBlock . content . nodes
136+ ]
137+ )
138+ ) ;
139+ }
140+
141+ this . _appendSection ( output , tsdocComment . summarySection ) ;
122142 }
123143 }
124144
@@ -161,15 +181,17 @@ export class MarkdownDocumenter {
161181 }
162182
163183 if ( apiItem instanceof ApiDocumentedItem ) {
164- if ( apiItem . tsdocComment ) {
184+ const tsdocComment : DocComment | undefined = apiItem . tsdocComment ;
185+
186+ if ( tsdocComment ) {
165187 // Write the @remarks block
166- if ( apiItem . tsdocComment . remarksBlock ) {
188+ if ( tsdocComment . remarksBlock ) {
167189 output . appendNode ( new DocHeading ( { configuration : this . _tsdocConfiguration , title : 'Remarks' } ) ) ;
168- this . _appendSection ( output , apiItem . tsdocComment . remarksBlock . content ) ;
190+ this . _appendSection ( output , tsdocComment . remarksBlock . content ) ;
169191 }
170192
171193 // Write the @example blocks
172- const exampleBlocks : DocBlock [ ] = apiItem . tsdocComment . customBlocks . filter ( x => x . blockTag . tagNameWithUpperCase
194+ const exampleBlocks : DocBlock [ ] = tsdocComment . customBlocks . filter ( x => x . blockTag . tagNameWithUpperCase
173195 === StandardTags . example . tagNameWithUpperCase ) ;
174196
175197 let exampleNumber : number = 1 ;
0 commit comments