gabotechs / dep-tree

Tool for helping developers keep their code bases clean and decoupled. It allows visualising a code base complexity using a 3d force-directed graph of files and the dependencies between them.
https://github.com/gabotechs/dep-tree
MIT License
1.4k stars 35 forks source link

Export webpage files #92

Closed Attempt3035 closed 2 months ago

Attempt3035 commented 2 months ago

Hey @gabotechs! I'm curious your thoughts on implementing an export function in the cli, which would simply copy the output files to the specified dir rather than a temp folder. I really want to embed 3D graphs of our code bases inside our Docusaurus pages, which should work perfectly if all the generated files can easily be exported to a dir, that way we can add a dep-tree build command into our documentation CI/CD. If you're keen to implement this, I'd be super grateful, happy to help out in any way including updating readme etc, probably a simple quick feature for you to implement knowing the codebase though!

gabotechs commented 2 months ago

Hey! I think that should be possible now:

dep-tree path/to/entrypoint --no-browser-open --render-path foo.html

This will dump the html output in foo.html without opening it in a browser. Does that work for you?

Attempt3035 commented 2 months ago

Damn that works a treat! Thank you so much! 🚀🚀 Didn't see this in the docs, I'll have a crack editing the readme to add this in if that's okay, if I search the codebase by cmd.Flags() does that have all the extra options or is there other places I should look too?

gabotechs commented 2 months ago

Not all the CLI options are in the docs, they are discoverable by appending the --help flag in the cli, that will output the available flags with the descriptions. This one is discoverable by:

dep-tree entropy --help

My suggestion is: instead of documenting all the flags one by one in the README.md, let the users know that all the available flags can be displayed by appending the command with a --help flag

Attempt3035 commented 2 months ago

Ahh gotcha, I ran -h and thought that was everything, I didn't realise dep-tree -h and --help give different outputs. (but dep-tree entropy -h does display everything) Maybe we could merge these and have it in the docs somewhere, then it should be clear enough 👍👍