mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-29 19:44:53 +02:00
22 lines
769 B
JavaScript
22 lines
769 B
JavaScript
import * as skills from './skills.js';
|
|
import * as world from './world.js';
|
|
|
|
|
|
export function docHelper(functions, module_name) {
|
|
let docstring = '';
|
|
for (let skillFunc of functions) {
|
|
let str = skillFunc.toString();
|
|
if (str.includes('/**')){
|
|
docstring += module_name+'.'+skillFunc.name;
|
|
docstring += str.substring(str.indexOf('/**')+3, str.indexOf('**/')) + '\n';
|
|
}
|
|
}
|
|
return docstring;
|
|
}
|
|
|
|
export function getSkillDocs() {
|
|
let docstring = "\n*SKILL DOCS\nThese skills are javascript functions that can be called when writing actions and skills.\n";
|
|
docstring += docHelper(Object.values(skills), 'skills');
|
|
docstring += docHelper(Object.values(world), 'world');
|
|
return docstring + '*\n';
|
|
}
|