Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tree-like layouts in Org-Mode

Tags:

emacs

org-mode

Say I want to enter information in an Org file that could be displayed in a tree-like format. Can Org help me with this?

For example I want Org to display a hierarchy of entities as follows:

ROOT
├── foo
│   └── bar
├── baz
├── bax
├── src
│   ├── main
│   │   ├── java
│   │   │   └── something
│   │   └── fine
│   ├── yes
│   └── no

How can I enter this information in a way that Org understands it so that it can render the tree as above?

like image 355
Amelio Vazquez-Reina Avatar asked Oct 26 '25 21:10

Amelio Vazquez-Reina


1 Answers

You might be interested by ditaa block for this:

#+name: tree
#+begin_src ditaa
  ROOT      
  |
  +--foo
  |  +----bar
  |  
  +--baz   
  +--bax   
  +--src   
  |  +--main
  |  |  +---java
  |  |  |   +---something
  |  |  |
  |  |  +---fine
  |  |
  |  +--yes
  |  +--no
#+end_src

typing C-c ` in the src block will put you in artist-mode, a mode made for editing ascii art and that should make editing those tree easier.

like image 54
Rémi Avatar answered Oct 28 '25 19:10

Rémi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!