generate text tree for a non-existant folder structure

3.7k views Asked by At

I want to generate a beautiful text rendering of a file system / folder structure that does not exist. Imagine I want to propose a file system layout, I would like to express this in an easy way I can quickly type down. For instance, given an input like this:

another
    folder
    log.txt
final
hi.py
some
    folder
        file.txt

where hierarchy is simply expressed by Tabs. Could be any other encoding though.

I would like to get a beatiful output like tree could generate:

.
├── another
│   ├── folder
│   └── log.txt
├── final
├── hi.py
└── some
    └── folder
        └── file.txt

The goal here is to avoid typing non-type-able but beautiful characters like └── or ├──. Ideally, a web-version of this tool would be desirable.

There are a bunch of seemingly related SO posts: What tool to use to draw file tree diagram or Representing Directory & File Structure in Markdown Syntax. However, all of them need an existing folder structure.

2

There are 2 answers

0
Adam On BEST ANSWER

I think this is the tool you want: tree.nathanfriend.io . It is a simple two pane website. On the left you enter exactly what you showed as sample input (with tabs). On the right it shows you exactly what you requested as output. Example with your sample input

1
dank8 On

What you have expressed as input is very close to YAML structure.

I'm unable to determine where you want to use the beautified result.

are you a developer bulk document generation:

are you a technical or business writer giving a presentation: