@@ -91,6 +91,7 @@ export interface IMarkdownDocumenterOptions {
91
91
apiModel : ApiModel ;
92
92
documenterConfig : DocumenterConfig | undefined ;
93
93
outputFolder : string ;
94
+ addFileNameSuffix : boolean ;
94
95
}
95
96
96
97
/**
@@ -104,11 +105,13 @@ export class MarkdownDocumenter {
104
105
private readonly _markdownEmitter : CustomMarkdownEmitter ;
105
106
private readonly _outputFolder : string ;
106
107
private readonly _pluginLoader : PluginLoader ;
108
+ private readonly _addFileNameSuffix : boolean ;
107
109
108
110
public constructor ( options : IMarkdownDocumenterOptions ) {
109
111
this . _apiModel = options . apiModel ;
110
112
this . _documenterConfig = options . documenterConfig ;
111
113
this . _outputFolder = options . outputFolder ;
114
+ this . _addFileNameSuffix = options . addFileNameSuffix ;
112
115
this . _tsdocConfiguration = CustomDocNodes . configuration ;
113
116
this . _markdownEmitter = new CustomMarkdownEmitter ( this . _apiModel ) ;
114
117
@@ -123,7 +126,7 @@ export class MarkdownDocumenter {
123
126
outputFolder : this . _outputFolder ,
124
127
documenter : new MarkdownDocumenterAccessor ( {
125
128
getLinkForApiItem : ( apiItem : ApiItem ) => {
126
- return getLinkForApiItem ( apiItem ) ;
129
+ return getLinkForApiItem ( apiItem , this . _addFileNameSuffix ) ;
127
130
}
128
131
} )
129
132
} ) ;
@@ -156,7 +159,7 @@ export class MarkdownDocumenter {
156
159
// write to file
157
160
const filename : string = path . join (
158
161
this . _outputFolder ,
159
- getFilenameForApiItem ( apiItem )
162
+ getFilenameForApiItem ( apiItem , this . _addFileNameSuffix )
160
163
) ;
161
164
const stringBuilder : StringBuilder = new StringBuilder ( ) ;
162
165
@@ -172,7 +175,7 @@ export class MarkdownDocumenter {
172
175
this . _markdownEmitter . emit ( stringBuilder , output , {
173
176
contextApiItem : apiItem ,
174
177
onGetFilenameForApiItem : ( apiItemForFilename : ApiItem ) => {
175
- return getLinkForApiItem ( apiItemForFilename ) ;
178
+ return getLinkForApiItem ( apiItemForFilename , this . _addFileNameSuffix ) ;
176
179
}
177
180
} ) ;
178
181
@@ -393,7 +396,11 @@ export class MarkdownDocumenter {
393
396
case ApiItemKind . Constructor : {
394
397
constructorsTable . addRow (
395
398
new DocTableRow ( { configuration } , [
396
- createTitleCell ( apiMember , configuration ) ,
399
+ createTitleCell (
400
+ apiMember ,
401
+ configuration ,
402
+ this . _addFileNameSuffix
403
+ ) ,
397
404
createModifiersCell ( apiMember , configuration ) ,
398
405
createDescriptionCell ( apiMember , configuration )
399
406
] )
@@ -407,7 +414,11 @@ export class MarkdownDocumenter {
407
414
case ApiItemKind . Method : {
408
415
methodsTable . addRow (
409
416
new DocTableRow ( { configuration } , [
410
- createTitleCell ( apiMember , configuration ) ,
417
+ createTitleCell (
418
+ apiMember ,
419
+ configuration ,
420
+ this . _addFileNameSuffix
421
+ ) ,
411
422
createModifiersCell ( apiMember , configuration ) ,
412
423
createDescriptionCell ( apiMember , configuration )
413
424
] )
@@ -422,7 +433,11 @@ export class MarkdownDocumenter {
422
433
if ( ( apiMember as ApiPropertyItem ) . isEventProperty ) {
423
434
eventsTable . addRow (
424
435
new DocTableRow ( { configuration } , [
425
- createTitleCell ( apiMember , configuration ) ,
436
+ createTitleCell (
437
+ apiMember ,
438
+ configuration ,
439
+ this . _addFileNameSuffix
440
+ ) ,
426
441
createModifiersCell ( apiMember , configuration ) ,
427
442
this . _createPropertyTypeCell ( apiMember ) ,
428
443
createDescriptionCell ( apiMember , configuration )
@@ -435,7 +450,11 @@ export class MarkdownDocumenter {
435
450
} else {
436
451
propertiesTable . addRow (
437
452
new DocTableRow ( { configuration } , [
438
- createTitleCell ( apiMember , configuration ) ,
453
+ createTitleCell (
454
+ apiMember ,
455
+ configuration ,
456
+ this . _addFileNameSuffix
457
+ ) ,
439
458
createModifiersCell ( apiMember , configuration ) ,
440
459
this . _createPropertyTypeCell ( apiMember ) ,
441
460
createDescriptionCell ( apiMember , configuration )
@@ -509,7 +528,11 @@ export class MarkdownDocumenter {
509
528
case ApiItemKind . MethodSignature : {
510
529
methodsTable . addRow (
511
530
new DocTableRow ( { configuration } , [
512
- createTitleCell ( apiMember , configuration ) ,
531
+ createTitleCell (
532
+ apiMember ,
533
+ configuration ,
534
+ this . _addFileNameSuffix
535
+ ) ,
513
536
createDescriptionCell ( apiMember , configuration )
514
537
] )
515
538
) ;
@@ -523,7 +546,11 @@ export class MarkdownDocumenter {
523
546
if ( ( apiMember as ApiPropertyItem ) . isEventProperty ) {
524
547
eventsTable . addRow (
525
548
new DocTableRow ( { configuration } , [
526
- createTitleCell ( apiMember , configuration ) ,
549
+ createTitleCell (
550
+ apiMember ,
551
+ configuration ,
552
+ this . _addFileNameSuffix
553
+ ) ,
527
554
this . _createPropertyTypeCell ( apiMember ) ,
528
555
createDescriptionCell ( apiMember , configuration )
529
556
] )
@@ -534,7 +561,11 @@ export class MarkdownDocumenter {
534
561
} else {
535
562
propertiesTable . addRow (
536
563
new DocTableRow ( { configuration } , [
537
- createTitleCell ( apiMember , configuration ) ,
564
+ createTitleCell (
565
+ apiMember ,
566
+ configuration ,
567
+ this . _addFileNameSuffix
568
+ ) ,
538
569
this . _createPropertyTypeCell ( apiMember ) ,
539
570
createDescriptionCell ( apiMember , configuration )
540
571
] )
@@ -686,7 +717,10 @@ export class MarkdownDocumenter {
686
717
configuration,
687
718
tagName : '@link' ,
688
719
linkText : unwrappedTokenText ,
689
- urlDestination : getLinkForApiItem ( apiItemResult . resolvedApiItem )
720
+ urlDestination : getLinkForApiItem (
721
+ apiItemResult . resolvedApiItem ,
722
+ this . _addFileNameSuffix
723
+ )
690
724
} )
691
725
) ;
692
726
continue ;
@@ -714,7 +748,7 @@ export class MarkdownDocumenter {
714
748
715
749
for ( const apiMember of apiModel . members ) {
716
750
const row : DocTableRow = new DocTableRow ( { configuration } , [
717
- createTitleCell ( apiMember , configuration ) ,
751
+ createTitleCell ( apiMember , configuration , this . _addFileNameSuffix ) ,
718
752
createDescriptionCell ( apiMember , configuration )
719
753
] ) ;
720
754
@@ -755,7 +789,11 @@ export class MarkdownDocumenter {
755
789
756
790
for ( const entryPoint of apiContainer . entryPoints ) {
757
791
const row : DocTableRow = new DocTableRow ( { configuration } , [
758
- createEntryPointTitleCell ( entryPoint , configuration ) ,
792
+ createEntryPointTitleCell (
793
+ entryPoint ,
794
+ configuration ,
795
+ this . _addFileNameSuffix
796
+ ) ,
759
797
createDescriptionCell ( entryPoint , configuration )
760
798
] ) ;
761
799
@@ -828,7 +866,7 @@ export class MarkdownDocumenter {
828
866
829
867
for ( const apiMember of apiMembers ) {
830
868
const row : DocTableRow = new DocTableRow ( { configuration } , [
831
- createTitleCell ( apiMember , configuration ) ,
869
+ createTitleCell ( apiMember , configuration , this . _addFileNameSuffix ) ,
832
870
createDescriptionCell ( apiMember , configuration )
833
871
] ) ;
834
872
0 commit comments