9

I am writing a wiki article and wondering what is the proper way to write a directory scheme?

I am doing something like

main folder
- sub folder
- sub folder
...

But I'm stuck after that.

Any help?

3
  • Where are you stuck? This looks OK to me. What's the problem? Nov 8, 2011 at 22:33
  • So what is the problem?
    – NoChance
    Nov 8, 2011 at 22:33
  • I have folders under that? Do I just keep adding -'s?
    – Steven
    Nov 8, 2011 at 22:36

2 Answers 2

10
root
  - sub1
    - sub1a
    - sub1b
  - sub2
  - sub3

keep the indention consistent ( I used 2 spaces ) and use a <pre/> or <code/> block in your html

you can try and make it look more like a tree control with a | if you want to stick to ASCII characters

root
  |- sub1
  | |- sub1a
  | |- sub1b
  |- sub2
  |- sub3

or use Unicode Characters from the Character Map Software provided by your Operating System

root
  ├ sub1
  | ├ sub1a
  | └ sub1b
  ├ sub2
  └ sub3
4

I find the output of the tree command very readable. Here's an example that uses Jarrod's directory structure:

root
├── sub1
│   ├── sub1a
│   └── sub1b
├── sub2
└── sub3

Not the answer you're looking for? Browse other questions tagged or ask your own question.