How to properly format directory tree in Confluence?
Asked Answered
A

4

9

I want to properly format the directory tree diagram, like:

   - /folder1 
          - /folder2
          - /folder3
               - file1
               - file2

What markup should I use for this purpose?

Acknowledge answered 26/10, 2017 at 8:23 Comment(0)
A
11

I know I am digging up the subject, but I had the same question while writing documentation, and none of the proposed solutions suited me (like the author it seems). So for future reference, here another solution

Using only ascii characters to form the tree structure (│, ├, ─, └), and Shift + Enter between lines to reduce line spacing. It's quite visual

Ascii tree representation

├─ folder1
│   ├─ subFolder1
│   ├─ subFolder2
│   ├─ subFolder3
│   └─ subFolder4
└─ folder2
Anastrophe answered 7/6, 2021 at 14:28 Comment(0)
E
5

If you have access to the Linux tree command you can do tree -Q --charset=ascii. (you can use cygwin under Windows) This is not the same as MTD's answer because you have to account for the output characters and quoting the filenames with spaces. If you don't use --charset=ascii you will get characters that Confluence can't handle.

tree -Q --charset=ascii
.
`-- "Folder 1"
    |-- "Folder 2"
    `-- "Folder 3"
        |-- "File 1"
        `-- "File 2"

3 directories, 2 files

Then place it in a code block on Confluence

enter image description here

Erlin answered 13/12, 2018 at 23:21 Comment(0)
G
3

I've just used the Code Block macro and inserted plain text as in your question, or the output of tree -d .

Gautea answered 22/1, 2018 at 18:57 Comment(1)
Corresponding windows command, would be 'tree . /F /A'Plaque
T
2

Are you looking for something like below snapshot? If so, then this is how you can achieve this.

  • Type - (dash)and press space to create a bullet.
  • Press tab to create a child bullet point.
  • Press enter to add multiple bullet points and so on.

You can use toolbar icons to do the above formatting but it's easy for me to use keyboard hence provided you this approach.

enter image description here You can learn more about text formatting in Confluence from Atlassian's documentation:

Thank you!

Twophase answered 11/11, 2017 at 16:3 Comment(2)
That's really nice, but is not exactly what I am looking for. Anyway thank you for your efforts!Acknowledge
Let me know what exactly are you looking for in detail? I would try to improve my answer.Twophase

© 2022 - 2024 — McMap. All rights reserved.