Treeview language definition for Prism
JavaScript
Latest commit 3d235d6 Dec 17, 2014 @Golmote Update README.md
Removed test
Permalink
Failed to load latest commit information.
README.md Update README.md Dec 17, 2014
prism-treeview.css Initial commit Dec 13, 2014
prism-treeview.js

README.md

prism-treeview

Treeview language definition for Prism. Based on kbjr's initial idea (https://github.com/LeaVerou/prism/issues/193)

Icons are from Font Awesome.

Usage

Include the CSS file after Prism theme, and the JS file after Prism core. You may use tree -F to get a compatible text structure.

Example code

<pre><code class="language-treeview">
root_folder/
|-- a first folder/
|   |-- holidays.mov
|   |-- javascript-file.js
|   `-- some_picture.jpg
|-- documents/
|   |-- spreadsheet.xls
|   |-- manual.pdf
|   |-- document.docx
|   `-- presentation.ppt
|       `-- test    
|-- empty_folder/
|-- going deeper/
|   |-- going deeper/
|   |   `-- going deeper/
|   |        `-- going deeper/
|   |            `-- .secret_file
|   |-- style.css
|   `-- index.html
|-- music and movies/
|   |-- great-song.mp3
|   |-- S01E02.new.episode.avi
|   |-- S01E02.new.episode.nfo
|   `-- track 1.cda
|-- .gitignore
|-- .htaccess
|-- .npmignore
|-- archive 1.zip
|-- archive 2.tar.gz
|-- logo.svg
`-- README.md
</code></pre>

Result

Result

Alternative syntax

You can also use the following box-drawing characters to represent the tree : ─│└├

<pre><code class="language-treeview">
root_folder/
├── a first folder/
|   ├── holidays.mov
|   ├── javascript-file.js
|   └── some_picture.jpg
├── documents/
|   ├── spreadsheet.xls
|   ├── manual.pdf
|   ├── document.docx
|   └── presentation.ppt
└── etc.
</code></pre>