2023-11-07 09:44:56 -06:00
|
|
|
import * as skills from './skills.js';
|
2023-11-07 20:21:19 -08:00
|
|
|
import * as world from './world.js';
|
2023-11-07 09:44:56 -06:00
|
|
|
|
2023-11-08 19:24:24 -06:00
|
|
|
|
|
|
|
export function docHelper(functions, module_name) {
|
2025-02-08 22:30:36 -08:00
|
|
|
let docArray = [];
|
2023-11-08 19:24:24 -06:00
|
|
|
for (let skillFunc of functions) {
|
2023-11-07 09:44:56 -06:00
|
|
|
let str = skillFunc.toString();
|
2025-02-08 22:30:36 -08:00
|
|
|
if (str.includes('/**')) {
|
|
|
|
let docEntry = `${module_name}.${skillFunc.name}\n`;
|
|
|
|
docEntry += str.substring(str.indexOf('/**') + 3, str.indexOf('**/')).trim();
|
|
|
|
docArray.push(docEntry);
|
2023-11-07 20:21:19 -08:00
|
|
|
}
|
2023-11-07 09:44:56 -06:00
|
|
|
}
|
2025-02-08 22:30:36 -08:00
|
|
|
return docArray;
|
2023-11-07 09:44:56 -06:00
|
|
|
}
|
|
|
|
|
2024-01-25 13:25:36 -08:00
|
|
|
export function getSkillDocs() {
|
2025-02-08 22:30:36 -08:00
|
|
|
let docArray = [];
|
|
|
|
docArray = docArray.concat(docHelper(Object.values(skills), 'skills'));
|
|
|
|
docArray = docArray.concat(docHelper(Object.values(world), 'world'));
|
|
|
|
return docArray;
|
2023-11-07 09:44:56 -06:00
|
|
|
}
|