Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

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?

share|improve this question

closed as off topic by David Thornley, FrustratedWithFormsDesigner, Anna Lear Nov 15 '11 at 13:43

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

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

2 Answers 2

up vote 5 down vote accepted
  - 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

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

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

  ├ sub1
  | ├ sub1a
  | └ sub1b
  ├ sub2
  └ sub3
share|improve this answer

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

├── sub1
│   ├── sub1a
│   └── sub1b
├── sub2
└── sub3
share|improve this answer

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