@@ -57,15 +57,9 @@ const TYPEDOC_KINDS = {
5757}
5858
5959const 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' ,
6963 'Constants' ,
7064 'Enumeration Members'
7165] ;
@@ -79,22 +73,23 @@ const groupSort = (g1, g2) => {
7973
8074function getGroupName ( object ) {
8175 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' ) ,
8278 'Errors' : ( x ) => x . name . toLowerCase ( ) . includes ( 'error' ) ,
83- 'Main Classes' : ( x ) => [ 'Actor' , 'Dataset' , 'KeyValueStore' , 'RequestQueue' ] . includes ( x . name ) ,
79+ 'Classes' : ( x ) => x . kindString === 'Class' ,
8480 'Main Clients' : ( x ) => [ 'ApifyClient' , 'ApifyClientAsync' ] . includes ( x . name ) ,
8581 'Async Resource Clients' : ( x ) => x . name . toLowerCase ( ) . includes ( 'async' ) ,
8682 'Resource Clients' : ( x ) => x . kindString === 'Class' && x . name . toLowerCase ( ) . includes ( 'client' ) ,
87- 'Helper Classes' : ( x ) => x . kindString === 'Class' ,
8883 'Methods' : ( x ) => x . kindString === 'Method' ,
8984 'Constructors' : ( x ) => x . kindString === 'Constructor' ,
9085 'Properties' : ( x ) => x . kindString === 'Property' ,
9186 'Constants' : ( x ) => x . kindString === 'Enumeration' ,
92- 'Enumeration Members ' : ( x ) => x . kindString === 'Enumeration Member' ,
87+ 'Enumeration members ' : ( x ) => x . kindString === 'Enumeration Member' ,
9388 } ;
9489
9590 const [ group ] = Object . entries ( groupPredicates ) . find (
9691 ( [ _ , predicate ] ) => predicate ( object )
97- ) ;
92+ ) ?? [ 'Other' ] ;
9893
9994 return group ;
10095}
@@ -162,7 +157,8 @@ function extractArgsAndReturns(docstring) {
162157
163158// Objects with decorators named 'ignore_docs' or with empty docstrings will be ignored
164159function 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' ;
166162}
167163
168164// Each object in the Typedoc structure has an unique ID,
@@ -207,13 +203,22 @@ function convertObject(obj, parent, module) {
207203 moduleName = moduleShortcuts [ fullName ] . replace ( `.${ member . name } ` , '' ) ;
208204 }
209205
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+
210214 // Create the Typedoc member object
211215 let typedocMember = {
212216 id : oid ++ ,
213217 name : member . name ,
214218 module : moduleName , // This is an extension to the original Typedoc structure, to support showing where the member is exported from
215219 ...typedocKind ,
216220 flags : { } ,
221+ bases : member . bases ,
217222 comment : member . docstring ? {
218223 summary : [ {
219224 kind : 'text' ,
@@ -231,6 +236,10 @@ function convertObject(obj, parent, module) {
231236 } ] ,
232237 } ;
233238
239+ if ( ! GROUP_ORDER . includes ( getGroupName ( typedocMember ) ) && parent . kindString === 'Project' ) {
240+ continue ;
241+ }
242+
234243 if ( typedocMember . kindString === 'Method' ) {
235244 const { parameters, returns } = extractArgsAndReturns ( member . docstring ?. content ?? '' ) ;
236245
0 commit comments