@@ -316,44 +316,44 @@ jobs:
316316 const contract = JSON.parse(fs.readFileSync(contractPath, 'utf8'));
317317
318318 const pluginType = contract.type || file.replace('-contract.json', '');
319- doc += \"$($1)" ;
320- doc += \"$($1)" ;
319+ doc += '## ' + pluginType.charAt(0).toUpperCase() + pluginType.slice(1) + ' Plugin\\n\\n' ;
320+ doc += '**Version:** ' + (contract.version || '1.0.0') + '\\n\\n' ;
321321
322322 if (contract.description) {
323- doc += \"$($1)" ;
323+ doc += contract.description + '\\n\\n' ;
324324 }
325325
326326 if (contract.methods) {
327327 doc += '### Methods\\n\\n';
328328
329329 for (const method of contract.methods) {
330- doc += \"$($1)" ;
330+ doc += '#### ' + method.name + '()\\n\\n' ;
331331
332332 if (method.description) {
333- doc += \"$($1)" ;
333+ doc += method.description + '\\n\\n' ;
334334 }
335335
336336 doc += '**Parameters:**\\n\\n';
337337 if (Array.isArray(method.parameters)) {
338338 for (const param of method.parameters) {
339339 if (typeof param === 'string') {
340- doc += \"$($1)" ;
340+ doc += '- ' + param + '\\n' ;
341341 } else {
342342 const required = param.required ? '' : ' (optional)';
343- doc += \"$($1)" ;
343+ doc += '- **' + param.name + '** (' + (param.type || 'any') + ')' + required + '\\n' ;
344344 }
345345 }
346346 } else {
347- doc += \"$($1)" ;
347+ doc += '- None\\n' ;
348348 }
349349
350350 doc += '\\n**Returns:**\\n\\n';
351351 if (typeof method.returns === 'string') {
352- doc += \"$($1)" ;
352+ doc += '- ' + method.returns + '\\n\\n' ;
353353 } else {
354- doc += \"$($1)" ;
354+ doc += '- **Type:** ' + (method.returns.type || 'any') + '\\n' ;
355355 if (method.returns.description) {
356- doc += \"$($1)" ;
356+ doc += '- **Description:** ' + method.returns.description + '\\n' ;
357357 }
358358 doc += '\\n';
359359 }
0 commit comments