emad-elsaid / dirtree

Visualizing files paths as an interactive tree, works nicely with gnu linux tools such as find, ls, or git ls-files
MIT License
118 stars 11 forks source link

jQuery and D3.js hardcoded into the template file for maximum portabi… #2

Closed akhal3d96 closed 7 years ago

akhal3d96 commented 7 years ago

This was made so that the gem functions properly even without internet access.

emad-elsaid commented 7 years ago

I wouldn't advise doing that, but if we want the user to serve this content form his machine I would prefer another general approach.

1- generate the template 2- if the user passed a key to the command like "--local-deps" to server dependencies from local machine 3- you post process the output to replace any script tag with src to be replaced the script tag with that src URL content 4- now that will work for both users that want deps local or from the internet and will work for all templates in the future and we will have a clean template in our repositories and also it'll be easier to update the template dependencies version as it's as easy as modifying the link in the script tag.

akhal3d96 commented 7 years ago

This seems good but about the local dependencies from the local machine approach, can't we just inject the source of the libraries instead of pointing to them locally? Either ways I want to implement this feature myself.

emad-elsaid commented 7 years ago

Yes that is the approach I feel better, replace the script tag to have the content inside the page not linked locally, just like you did in this PR but this should be done automatically via dirtree itself