jctree documentation

jcTree Documentation

In this post I will show you how to use jcTree.exe to create a Javascript enabled tree from your command line.

First up lets check out the command help as shown below

[geshi lang=”csharp” nums=”1″ target=”_self” ]

Download this Utility from this URL

http://jaspreetchahal.org/jctree-a-c-tool-to-create-jquery-javascript-enabled-folder-or-directory-tree-and-output-to-html-file/

I am not going to explain what each switch does but I am going to narrate couple of use cases

  1. Create a tree from Directory structure and save it to index.html under a given target folder
  2. Create a tree from Directory structure and save it to index.html under a given target folder with TXT files only and apply classic jsTree theme to it with verbose mode.

Test Directory Structure

C:\cutils\JCRSBackup.exe
C:\cutils\License.txt
C:\cutils\print.txt
C:\cutils\Readme.txt
C:\cutils\RackSpaceWindowsClient
C:\cutils\RackSpaceWindowsClient\License.txt

Scenario 1

Assuming the above directory structure exists lets create a tree for above directory structure and store it in c:\demo folder. One good thing about this Util is that if the target folder does not exist it will create it automatically

The command

When you run the above command “demo” folder will be created with index.html inside it. Notice that jsTree will also be copied to the destination folder. This is a requirement. Without it your tree will only be a unordered HTML list.

Lets check out the browser output

So we get nice tree and each node is a link to the file itself. From here on you can do whatever you like with your newly created file.

Scenario 2

Assuming the directory structure is the same as in Scenario 1 use the command below

The command

When you run the above command “demo” folder will be created with index.html inside it. Notice that jsTree branch will also be copied to the destination folder too. This is a requirement. Without it, your tree will only be a unordered HTML list.

Lets check out the browser output

So we get nice tree and each node is a link to the file itself. From here on you can do whatever you like with your newly created file. Note that all but txt files were skipped.

By itself this util still has long way to go. I just wanted to use it in one of my project and then I created it just so that someone else can find it useful.

I need feedback from you guys to help me improve this Util.

I hope this help.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.