Skip to content
A browser-based file navigator/viewer for my friend Shuo to run on a publicly accessible server without an OS.
Ruby JavaScript CSS HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
imgs
test_dir
this is another test
treeify_assets
.gitignore
.jshintrc
README.md
index_builder.rb

README.md

Treeify

I don't really know how to describe this thing. It's like a file system viewer but also a file viewer that can be run in any directory on a server (which is accessible via browser) to make interaction with that directory more OS-like. It's just a fun little project that I started to help out a friend.

Overview

Once the script has been run, you will have an index.html file in the root directory you selected. Opening that file in a browser you will see the collapsed tree-view of the directory.

To see more detail, you can click the Expand All button.

Clicking on a file opens the document view.

Because the document view is an iframe, files like PDFs will be displayed the same way your browser usually displays them, but without leaving the Treeify-generated index page.

Install

Basically you can run this as-is from the command line, or you have to go through the process of making it an executable shell command.

To run as is

  • Put it wherever you want to put it.
  • Navigate to that directory and run ruby index_builder.rb
  • When prompted about which directory, you will always answer "no" to the first question, because I assume you want to use this on your own directories, not the project itself.
    • When prompted for the path, you can type the path just like you would with cd or ls or provide an absolute path. The latter may look prettier, but they'll both get the job done.
  • If you are asked about keeping an existing index.html file, this probably means you have already run Treeify on that directory.
    • If you are sure you have not, then you probably don't want to overwrite it, in which case the existing file will be moved to index2.html.
  • When asked about relative or absolute paths, you'll definitely want relative if this is to be run on a server. I'm actually not really sure when you'd want absolute paths, but I assumed there would be a use case at some point. idk.

To make it a shell command

I was going to put all that info here, but it's already been done. Just follow these instructions.

I'm not 100% sure that it will work correctly as a shell script, but I kind of expect that it will.

Next Steps

Short-term

  • Fix known bugs
  • Pretty it up a bit with some CSS
  • Package as a gem

Long-term

  • Add more interactive features like
    • upload/download
    • delete
    • edit, possibly via VIM, or just a simple form for plain text
  • Determine best/cleanest way to move CSS/JS portions elsewhere (maybe ~?) so treeify_assets is no longer needed in root directory and doesn't need to be written to multiple locations if Treeify is run multiple times for different directories
You can’t perform that action at this time.