Skip to content

Commit e042eaf

Browse files
committed
updated the file
1 parent 534b2b8 commit e042eaf

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Codebolt Library
1+
# Overview
22

33
Welcome to the Codebolt library.
File renamed without changes.

docusaurus.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const config: Config = {
6666
type: 'docSidebar',
6767
sidebarId: 'jsapiSidebar',
6868
position: 'left',
69-
label: 'JS Library',
69+
label: 'AI Agents',
7070
},
7171
{
7272
to: '/blog',

scripts/jsdoc_to_docusaurus.js

+24-6
Original file line numberDiff line numberDiff line change
@@ -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+
6676
if (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

Comments
 (0)