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” ]
1 2 3 4 5 6 7 8 9 |
Correct Usage: jctree -source=PathToDirectory -target=TargetDirectory [options] ---options--- -v verbose mode ->default is off -filename target file name -> default value is index.html -inclfs Include file size (switch only) -theme apple|default|classic|default-rtl, Default value is apple -treeid DOM ID for tree branch. Default value is jctreeit -filetypes *.* is default. You can have values e.g. *.html (all html files) or *.txt (all text files) or *c*.txt (all files that has 'c' in their names and ends with .txt) |
Download this Utility from this URL
I am not going to explain what each switch does but I am going to narrate couple of use cases
- Create a tree from Directory structure and save it to index.html under a given target folder
- 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
1 |
shell> jctree -source=c:\cutils -target=c:\demo |
1 |
screenshot |
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
1 |
shell> jctree -source=c:\cutils -target=c:\demo -v -theme=classic -filetypes=*.txt |
1 |
screenshot |
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