3
3
Document ,
4
4
} from 'dgeni' ;
5
5
6
+ import { CollectLinkableSymbolsProcessor } from './collect-linkable-symbols' ;
7
+
6
8
/**
7
9
* Adds a link tag ({@link }) around daffodil models, classes, etc.
8
10
*/
@@ -12,6 +14,8 @@ export class AddLinkTagToDaffodilReferencesProcessor implements Processor {
12
14
$runBefore = [ 'rendering-docs' ] ;
13
15
14
16
$process ( docs : Document [ ] ) : Document [ ] {
17
+ console . log ( CollectLinkableSymbolsProcessor . symbols ) ;
18
+
15
19
const docDictionary = docs . reduce ( ( acc , doc ) => ( {
16
20
...acc ,
17
21
[ doc . name ] : true ,
@@ -21,14 +25,16 @@ export class AddLinkTagToDaffodilReferencesProcessor implements Processor {
21
25
}
22
26
23
27
addLinksToDoc ( doc , docDictionary ) : Document {
24
- return {
25
- ...doc ,
26
- typeParams : this . addLinks ( doc . typeParams ?. slice ( 1 , doc . typeParams . length - 1 ) , docDictionary ) ,
27
- members : doc . members ?. map ( member => ( {
28
- ...member ,
29
- type : this . addLinks ( member . type , docDictionary ) ,
30
- } ) ) ,
31
- } ;
28
+ doc . typeParams = this . addLinks ( doc . typeParams ?. slice ( 1 , doc . typeParams . length - 1 ) , docDictionary ) ;
29
+ if ( doc . typeDefinition ) {
30
+ doc . typeDefinition = this . addLinks ( doc . typeDefinition , docDictionary ) ;
31
+ }
32
+ doc . members = doc . members ?. map ( member => ( {
33
+ ...member ,
34
+ type : this . addLinks ( member . type , docDictionary ) ,
35
+ } ) ) ;
36
+
37
+ return doc ;
32
38
}
33
39
34
40
addLinks ( str : string , docDictionary ) : string {
0 commit comments