@@ -57,15 +57,9 @@ const TYPEDOC_KINDS = {
57
57
}
58
58
59
59
const GROUP_ORDER = [
60
- 'Main Classes' ,
61
- 'Main Clients' ,
62
- 'Resource Clients' ,
63
- 'Async Resource Clients' ,
64
- 'Helper Classes' ,
65
- 'Errors' ,
66
- 'Constructors' ,
67
- 'Methods' ,
68
- 'Properties' ,
60
+ 'Classes' ,
61
+ 'Data structures' ,
62
+ 'Scrapy Integration' ,
69
63
'Constants' ,
70
64
'Enumeration Members'
71
65
] ;
@@ -79,22 +73,23 @@ const groupSort = (g1, g2) => {
79
73
80
74
function getGroupName ( object ) {
81
75
const groupPredicates = {
76
+ 'Scrapy integration' : ( x ) => [ 'ApifyScheduler' , 'ActorDatasetPushPipeline' , 'ApifyHttpProxyMiddleware' , 'apply_apify_settings' ] . includes ( x . name ) ,
77
+ 'Data structures' : ( x ) => [ 'BaseModel' , 'TypedDict' ] . some ( base => x ?. bases ?. includes ( base ) ) || x ?. decorations ?. some ( d => d . name === 'dataclass' ) ,
82
78
'Errors' : ( x ) => x . name . toLowerCase ( ) . includes ( 'error' ) ,
83
- 'Main Classes' : ( x ) => [ 'Actor' , 'Dataset' , 'KeyValueStore' , 'RequestQueue' ] . includes ( x . name ) ,
79
+ 'Classes' : ( x ) => x . kindString === 'Class' ,
84
80
'Main Clients' : ( x ) => [ 'ApifyClient' , 'ApifyClientAsync' ] . includes ( x . name ) ,
85
81
'Async Resource Clients' : ( x ) => x . name . toLowerCase ( ) . includes ( 'async' ) ,
86
82
'Resource Clients' : ( x ) => x . kindString === 'Class' && x . name . toLowerCase ( ) . includes ( 'client' ) ,
87
- 'Helper Classes' : ( x ) => x . kindString === 'Class' ,
88
83
'Methods' : ( x ) => x . kindString === 'Method' ,
89
84
'Constructors' : ( x ) => x . kindString === 'Constructor' ,
90
85
'Properties' : ( x ) => x . kindString === 'Property' ,
91
86
'Constants' : ( x ) => x . kindString === 'Enumeration' ,
92
- 'Enumeration Members ' : ( x ) => x . kindString === 'Enumeration Member' ,
87
+ 'Enumeration members ' : ( x ) => x . kindString === 'Enumeration Member' ,
93
88
} ;
94
89
95
90
const [ group ] = Object . entries ( groupPredicates ) . find (
96
91
( [ _ , predicate ] ) => predicate ( object )
97
- ) ;
92
+ ) ?? [ 'Other' ] ;
98
93
99
94
return group ;
100
95
}
@@ -162,7 +157,8 @@ function extractArgsAndReturns(docstring) {
162
157
163
158
// Objects with decorators named 'ignore_docs' or with empty docstrings will be ignored
164
159
function isHidden ( member ) {
165
- return member . decorations ?. some ( d => d . name === 'ignore_docs' ) || member . name === 'ignore_docs' || ! member . docstring ?. content ;
160
+ return member . decorations ?. some ( d => d . name === 'ignore_docs' )
161
+ || member . name === 'ignore_docs' ;
166
162
}
167
163
168
164
// Each object in the Typedoc structure has an unique ID,
@@ -207,13 +203,22 @@ function convertObject(obj, parent, module) {
207
203
moduleName = moduleShortcuts [ fullName ] . replace ( `.${ member . name } ` , '' ) ;
208
204
}
209
205
206
+ if ( member . name === 'Actor' || ( member . name . endsWith ( 'Client' ) && ! member . name . endsWith ( 'StorageClient' ) ) || member . name === 'ListPage' ) {
207
+ continue ;
208
+ }
209
+
210
+ if ( member . name === '_ActorType' ) {
211
+ member . name = 'Actor' ;
212
+ }
213
+
210
214
// Create the Typedoc member object
211
215
let typedocMember = {
212
216
id : oid ++ ,
213
217
name : member . name ,
214
218
module : moduleName , // This is an extension to the original Typedoc structure, to support showing where the member is exported from
215
219
...typedocKind ,
216
220
flags : { } ,
221
+ bases : member . bases ,
217
222
comment : member . docstring ? {
218
223
summary : [ {
219
224
kind : 'text' ,
@@ -231,6 +236,10 @@ function convertObject(obj, parent, module) {
231
236
} ] ,
232
237
} ;
233
238
239
+ if ( ! GROUP_ORDER . includes ( getGroupName ( typedocMember ) ) && parent . kindString === 'Project' ) {
240
+ continue ;
241
+ }
242
+
234
243
if ( typedocMember . kindString === 'Method' ) {
235
244
const { parameters, returns } = extractArgsAndReturns ( member . docstring ?. content ?? '' ) ;
236
245
0 commit comments