@@ -31,9 +31,8 @@ function createCategoryFile(categoryPath, categoryName) {
3131 "collapsed" : true ,
3232 "className" : "red" ,
3333 "link" : {
34- "type" : "generated-index" ,
35- "title" : categoryName ,
36- "description" : "Provides Functionality for " + categoryName
34+ "type" : "doc" ,
35+ "id" : "cb_index"
3736 }
3837 } , null , 2 ) ) ;
3938 }
@@ -63,10 +62,23 @@ function writeToFile(filePath, frontMatterVars){
6362 }
6463}
6564
65+ function writeClassIndex ( categoryName , indexFilePath , classAllFrontMatters ) {
66+ let classIndexContent = '' ;
67+ classIndexContent += `# ${ categoryName } \n` ;
68+ classAllFrontMatters . forEach ( frontMatter => {
69+ classIndexContent += `- [${ frontMatter . data . name } ](${ frontMatter . data . link } ) - ${ frontMatter . cbbaseinfo . description } \n` ;
70+ } ) ;
71+ fs . writeFileSync ( indexFilePath , classIndexContent ) ;
72+ }
73+
74+
75+
6676if ( codeboltChild && codeboltChild . children ) {
6777 codeboltChild . children . forEach ( CbProperties => {
6878 const dir = `../docs/api/${ CbProperties . name } ` ;
6979
80+ let classAllFrontMatters = [ ] ;
81+
7082 //Check Folder
7183 if ( ! fs . existsSync ( dir ) ) {
7284 fs . mkdirSync ( dir , { recursive : true } ) ;
@@ -85,6 +97,7 @@ if (codeboltChild && codeboltChild.children) {
8597 "data" : {
8698 "name" : " " ,
8799 "category" : " " ,
100+ "link" : " "
88101 } ,
89102 "cbbaseinfo" : {
90103 "description" : " " ,
@@ -133,12 +146,17 @@ if (codeboltChild && codeboltChild.children) {
133146 } ) ;
134147 }
135148
149+ frontMatterVars . data . link = `${ frontMatterVars . data . name } ` ;
150+ const fileurl = `${ dir } /${ frontMatterVars . data . name } .md` ;
151+ writeToFile ( fileurl , frontMatterVars )
136152
137- const filePath = `${ dir } /${ frontMatterVars . data . name } .md` ;
138- writeToFile ( filePath , frontMatterVars )
139-
153+ classAllFrontMatters . push ( frontMatterVars ) ;
140154 } ) ;
141155 }
156+
157+ const classIndexFilePath = `${ dir } /cb_index.md` ;
158+ writeClassIndex ( CbProperties . name , classIndexFilePath , classAllFrontMatters )
159+
142160 } ) ;
143161} else {
144162 console . log ( 'codeboltChild has no children or does not exist.' ) ;
0 commit comments