GDScriptify
GDScriptify copied to clipboard
Nested filepaths and directory documentation
It seems that this tool only create the documentation for those files that lives in the "root" folder, together with project.godot
.
This will hardly be the case for a real life project (different than a showcase).
Are you planning to handle GDscript files that are inside folders in a more complex structure?
What gave you that impression? I might need to check the documetation, hehe!
This tool takes the root of the project, where project.godot
is located, as an entry point to search GDScript files recursively in all the directories inside of it.
I did try it out on my project and nothing happened, except for the creation of LICENSE_GDSCRIPTIFY.txt
Sorry I am being cryptic, I'll explain better.
I have a complex structure of gdfiles, The gd files are not really documented as your tool wants, but if I create one file with comments and docs it gives me the following error:
gdscriptify
C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\src\core\generateMarkdownFile.js:9
outputString += `# ${file.name}\n\n`
^
TypeError: Cannot read property 'name' of undefined
at module.exports (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\src\core\generateMarkdownFile.js:9:29)
at module.exports (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\src\core\generateCodeReferenceFile.js:83:9)
at module.exports (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\src\index.js:82:3)
at Object.<anonymous> (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\bin\gdscriptify:3:18)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
I am on Windows
I did try it out on my project and nothing happened, except for the creation of
LICENSE_GDSCRIPTIFY.txt
Thanks for the feedback! This is expected behaviour. But now that you pointed it out, maybe I'll add a warning or something when there are no documented files.
As for the error, it tricky for me to see what could have happened. Could you send a zip with a minimal project so I can reproduce it? Or at least the file you are trying to document (you can paste it here if you want).
Are you running gdscriptify
from the same folder as the Godot project? Are you using any options?
I am running it on the same folder of the Godot Project. I am using no options, and I am using on this project:
github.com/notapixelstudio/superstarfighter
(and I just add some comments on godot/globals/global.gd
)
I think I've track it down. I'll try to release a fix soon.
I've just released v1.1.0. Let's see if I could fix those bugs 🤞 You should just need to run npm update -g gdscriptify
.
oops ...
> gdscriptify
internal/fs/utils.js:332
throw err;
^
Error: ENOENT: no such file or directory, mkdir 'C:\Users\salvob\repos\superstarfighter\godot\docs\C:\Users\salvob\repos\superstarfighter\godot\map'
at Object.mkdirSync (fs.js:1013:3)
at module.exports (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\src\utils\mkdirpSync.js:5:8)
at module.exports (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\src\core\generateMarkdownFile.js:256:3)
at module.exports (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\src\core\generateCodeReferenceFile.js:103:9)
at module.exports (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\src\index.js:93:3)
at Object.<anonymous> (C:\Users\salvob\AppData\Roaming\npm\node_modules\gdscriptify\bin\gdscriptify:3:18)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
errno: -4058,
syscall: 'mkdir',
code: 'ENOENT',
path: 'C:\\Users\\salvob\\repos\\superstarfighter\\godot\\docs\\C:\\Users\\salvob\\repos\\superstarfighter\\godot\\map'
}