Skip to content

Commit 9ac49ea

Browse files
committed
added jsdoc
1 parent fc121c0 commit 9ac49ea

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scripts/jsdoc_to_docusaurus.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ if (codeboltChild && codeboltChild.children) {
8787
"cbparameters": {
8888
"parameters": [],
8989
"returns": {
90-
"signatureTypeName": " "
90+
"signatureTypeName": " ",
91+
"description": " "
9192
}
9293
}
9394
}
@@ -107,7 +108,15 @@ if (codeboltChild && codeboltChild.children) {
107108
frontMatterVars.data.category = CbProperties.name;
108109
frontMatterVars.data.name = CbFunctions.name;
109110
frontMatterVars.cbbaseinfo.description = CbFunctions.comment && CbFunctions.comment.summary && CbFunctions.comment.summary.length > 0 ? CbFunctions.comment.summary[0].text : ' ';
110-
111+
112+
113+
if (CbFunctions.comment && CbFunctions.comment.blockTags) {
114+
CbFunctions.comment.blockTags.forEach(blockTag => {
115+
if (blockTag.tag === "@returns") {
116+
frontMatterVars.cbparameters.returns.description = blockTag.content && blockTag.content.length > 0 ? blockTag.content[0].text : ' ';
117+
}
118+
});
119+
}
111120

112121
if (CbFunctions.type && CbFunctions.type.declaration && CbFunctions.type.declaration.signatures) {
113122
CbFunctions.type.declaration.signatures.forEach(signature => {
@@ -116,7 +125,7 @@ if (codeboltChild && codeboltChild.children) {
116125
parameterObj = {
117126
"name": param.name,
118127
"typeName": param.type.name,
119-
"description": param.comment && param.comment.text && param.comment.text.length > 0? param.comment.text[0].text :''
128+
"description": param.comment && param.comment.summary && param.comment.summary.length > 0? param.comment.summary[0].text :''
120129
}
121130
frontMatterVars.cbparameters.parameters.push(parameterObj);
122131
});

0 commit comments

Comments
 (0)