11import { marked } from 'marked' ;
22import path from 'path' ;
3- import { getFunctionsByTypeByCategory } from '@src/utils/functions' ;
4- import { getEventsByTypeByCategory } from '@src/utils/events' ;
3+ import { getFunctionsByCategory , getFunctionsByTypeByCategory } from '@src/utils/functions' ;
4+ import { getEventsByCategory , getEventsByTypeByCategory } from '@src/utils/events' ;
55import { getElementsByCategory , getElementCategory } from '@src/utils/elements' ;
66
77import type { ImageMetadata } from 'astro' ;
@@ -199,3 +199,30 @@ export function getSeeAlsoLinksForItem(theItem: any): SeeAlsoLinkGroup[] {
199199 const allSeeAlso = [ ...new Set ( [ ...seeAlso , ...addToSeeAlso ] ) ] ;
200200 return getSeeAlsoLinksFromList ( allSeeAlso ) ;
201201}
202+
203+ export function getUnfinishedPages ( pageType : 'functions' | 'events' ) : string [ ] {
204+ const unfinishedPages : string [ ] = [ ] ;
205+ const pagesByCategory = {
206+ functions : getFunctionsByCategory ( ) ,
207+ events : getEventsByCategory ( ) ,
208+ } ;
209+ for ( const category in pagesByCategory [ pageType ] ) {
210+ const items = pagesByCategory [ pageType ] [ category ] ;
211+ for ( const item of items ) {
212+ const data = item . data . shared || item . data . client || item . data . server || item . data ;
213+ // Check if item description contains 'NEEDS DOCUMENTATION'
214+ if ( data && data . description && data . description . includes ( 'NEEDS DOCUMENTATION' ) ) {
215+ unfinishedPages . push ( item . id ) ;
216+ } else {
217+ // Check if the item has no code examples
218+ const examples = item . data . shared ?. examples || item . data . client ?. examples || item . data . server ?. examples || item . data . examples ;
219+ if ( ! examples || examples . length === 0 ) {
220+ unfinishedPages . push ( item . id ) ;
221+ }
222+ }
223+ }
224+ }
225+ // Sort alphabetically
226+ unfinishedPages . sort ( ( a , b ) => a . localeCompare ( b ) ) ;
227+ return unfinishedPages ;
228+ }
0 commit comments