GDScriptify icon indicating copy to clipboard operation
GDScriptify copied to clipboard

Nested filepaths and directory documentation

Open salvob41 opened this issue 3 years ago • 9 comments

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?

salvob41 avatar Nov 17 '21 11:11 salvob41

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.

hiulit avatar Nov 17 '21 11:11 hiulit

I did try it out on my project and nothing happened, except for the creation of LICENSE_GDSCRIPTIFY.txt

salvob41 avatar Nov 17 '21 12:11 salvob41

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

salvob41 avatar Nov 17 '21 12:11 salvob41

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).

hiulit avatar Nov 17 '21 13:11 hiulit

Are you running gdscriptify from the same folder as the Godot project? Are you using any options?

hiulit avatar Nov 17 '21 13:11 hiulit

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)

salvob41 avatar Nov 17 '21 14:11 salvob41

I think I've track it down. I'll try to release a fix soon.

hiulit avatar Nov 18 '21 08:11 hiulit

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.

hiulit avatar Nov 22 '21 14:11 hiulit

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'
}

salvob41 avatar Nov 22 '21 21:11 salvob41