@@ -61,7 +61,7 @@ def from_int(cls, value: int):
61
61
0x100000 : cls .SET_SIGNATURE ,
62
62
0x200000 : cls .TYPE_ALIAS ,
63
63
0x400000 : cls .REFERENCE ,
64
- }. get ( value )
64
+ }[ value ]
65
65
66
66
def to_int (self ):
67
67
return {
@@ -88,11 +88,10 @@ def to_int(self):
88
88
self .SET_SIGNATURE : 0x100000 ,
89
89
self .TYPE_ALIAS : 0x200000 ,
90
90
self .REFERENCE : 0x400000 ,
91
- }. get ( self )
91
+ }[ self ]
92
92
93
93
94
94
# https://typedoc.org/guides/tags/
95
- # We might need to extract {@tags} as "inline tags".
96
95
class BlockTagKind (Enum ):
97
96
ALPHA : str = "@alpha"
98
97
BETA : str = "@beta"
@@ -107,11 +106,8 @@ class BlockTagKind(Enum):
107
106
GROUP : str = "@group"
108
107
HIDDEN : str = "@hidden"
109
108
IGNORE : str = "@ignore"
110
- INHERIT_DOC : str = "{@inheritDoc}"
111
109
INTERFACE : str = "@interface"
112
110
INTERNAL : str = "@internal"
113
- LABEL : str = "{@label}"
114
- LINK : str = "{@link}"
115
111
MODULE : str = "@module"
116
112
NAMESPACE : str = "@namespace"
117
113
OVERLOAD : str = "@overload"
@@ -138,6 +134,8 @@ class BlockTagKind(Enum):
138
134
class BlockTagContentKind (Enum ):
139
135
TEXT : str = "text"
140
136
CODE : str = "code"
137
+ INLINE_TAG = "inline-tag"
138
+
141
139
142
140
143
141
@dataclass (kw_only = True )
@@ -150,13 +148,18 @@ class FileRegistry:
150
148
class BlockTagContent :
151
149
kind : BlockTagContentKind
152
150
text : str
151
+ target : int | str | None = None
152
+ ts_link_text : str | None = None
153
153
154
154
def __str__ (self ) -> str :
155
- return self .text
155
+ return self .markdown ()
156
156
157
- @property
158
- def markdown (self ) -> str :
159
- return str (self )
157
+ def markdown (self , symbol_map : dict [int , Reflection ] | None = None ) -> str :
158
+ if self .target :
159
+ if isinstance (self .target , int ) and symbol_map :
160
+ return f'<autoref identifier="{ symbol_map [self .target ].path } ">{ self .text } </autoref>'
161
+ return f"[{ self .text } ]({ self .target } )"
162
+ return self .text
160
163
161
164
162
165
@dataclass (kw_only = True )
@@ -167,9 +170,8 @@ class BlockTag:
167
170
def __str__ (self ) -> str :
168
171
return "" .join (str (block ) for block in self .content )
169
172
170
- @property
171
- def markdown (self ) -> str :
172
- return str (self )
173
+ def markdown (self , ** kwargs ) -> str :
174
+ return "" .join (block .markdown (** kwargs ) for block in self .summary )
173
175
174
176
175
177
@dataclass (kw_only = True )
@@ -181,9 +183,8 @@ class Comment:
181
183
def __str__ (self ) -> str :
182
184
return "" .join (str (block ) for block in self .summary )
183
185
184
- @property
185
- def markdown (self ) -> str :
186
- return str (self )
186
+ def markdown (self , ** kwargs ) -> str :
187
+ return "" .join (block .markdown (** kwargs ) for block in self .summary )
187
188
188
189
189
190
@dataclass (kw_only = True )
0 commit comments