GitHub

Highlight-treeview.js

There are a few different directory tree structures automatically generated by OSs such as windows and linux(-based) systems using both ASCII and extended characters. With that in mind, highlight-treeview.js provides one class including language definition: treeview to handle specified workdir trees. You may use $ tree /F /A in windows or $ tree [-options] command in a Linux system to get automatically generated tree structures.


Examples

Example 1 (Extended Characters - Linux):

Before:

root
├── photos
|   ├── camp.gif
|   ├── festival.png
|   └── balloon.jpg
├── videos
|   ├── car-video.avi
|   ├── dance.mp4
|   ├── dance01.mpg
|   └── another video.divx
├── documents
|   ├── jsfile.js
|   ├── powerpoint.ppt
|   ├── chapter-01.asc
|   ├── archive-db.zip
|   └── configuration.conf
└── etc.

After:

root
├── photos
|   ├── camp.gif
|   ├── festival.png
|   └── balloon.jpg
├── videos
|   ├── car-video.avi
|   ├── dance.mp4
|   ├── dance01.mpg
|   └── another video.divx
├── documents
|   ├── jsfile.js
|   ├── powerpoint.ppt
|   ├── chapter-01.asc
|   ├── archive-db.zip
|   └── configuration.conf
└── etc.

Example 2 (ASCII - Linux):

Before:

root
|-- photos
|   |-- camp.gif
|   |-- festival.png
|   `-- balloon.jpg
|-- videos
|   |-- car-video.avi
|   |-- dance.mp4
|   |-- dance01.mpg
|   |-- another video.divx
|   `-- school videos
|       `-- firstday.flv
|-- documents
|   |-- jsfile.js
|   |-- powerpoint.ppt
|   |-- chapter-01.asc
|   |-- archive-db.zip
|   |-- .gitignore
|   |-- README
|   `-- configuration.conf
`-- etc.

After:

root
|-- photos
|   |-- camp.gif
|   |-- festival.png
|   `-- balloon.jpg
|-- videos
|   |-- car-video.avi
|   |-- dance.mp4
|   |-- dance01.mpg
|   |-- another video.divx
|   `-- school videos
|       `-- firstday.flv
|-- documents
|   |-- jsfile.js
|   |-- powerpoint.ppt
|   |-- chapter-01.asc
|   |-- archive-db.zip
|   |-- .gitignore
|   |-- README
|   `-- configuration.conf
`-- etc.

Example 3 (ASCII - Windows):

Before:

root
+---photos
|       camp.gif
|       festival.png
|       balloon.jpg
+---videos
|   |   car-video.avi
|   |   dance.mp4
|   |   dance01.mpg
|   |   another video.divx
|   \---school.videos
|           firstday.flv
+---documents
|       jsfile.js
|       powerpoint.ppt
|       chapter-01.asc
|       archive-db.zip
|       configuration.conf
|       README
\---etc.

After:

root
+---photos
|       camp.gif
|       festival.png
|       balloon.jpg
+---videos
|   |   car-video.avi
|   |   dance.mp4
|   |   dance01.mpg
|   |   another video.divx
|   \---school.videos
|           firstday.flv
+---documents
|       jsfile.js
|       powerpoint.ppt
|       chapter-01.asc
|       archive-db.zip
|       configuration.conf
|       README
\---etc.

Example 4 (Extended Characters - Windows):

Before:

root
├───photos
│       camp.gif
│       festival.png
│       balloon.jpg
├───videos
│   │   car-video.avi
│   │   dance.mp4
│   │   dance01.mpg
│   │   another video.divx
│   └───school videos
│           firstday.flv
├───documents
│       jsfile.js
│       powerpoint.ppt
│       chapter-01.asc
│       archive-db.zip
│       configuration.conf
└───etc.

After:

root
├───photos
│       camp.gif
│       festival.png
│       balloon.jpg
├───videos
│   │   car-video.avi
│   │   dance.mp4
│   │   dance01.mpg
│   │   another video.divx
│   └───school videos
│           firstday.flv
├───documents
│       jsfile.js
│       powerpoint.ppt
│       chapter-01.asc
│       archive-db.zip
│       configuration.conf
└───etc.