Print A Directory Tree On Github Readme

Words
70
Reading
1 min
7y
Listen to this post
~1 min

linux_terminal_wallpaper.png

A simple little markdown trick



Grab your tree. In a terminal enter/cd into the directory you want to map and...

tree



Or grab it from afar.

tree dir



Copy the results it spews out and use this template.

```bash
PASTE TREE HERE
```



Which gives us this lovely piece of markdown.

woo
├── composer.json
├── composer.lock
├── data.json
├── index.php
└── vendor
    ├── autoload.php
    ├── automattic
    │   └── woocommerce
    │       ├── LICENSE
    │       ├── README.md
    │       ├── composer.json
    │       ├── phpcs.xml
    │       ├── phpunit.xml.dist
    │       ├── src
    │       │   └── WooCommerce
    │       │       ├── Client.php
    │       │       └── HttpClient
    │       │           ├── BasicAuth.php
    │       │           ├── HttpClient.php
    │       │           ├── HttpClientException.php
    │       │           ├── OAuth.php
    │       │           ├── Options.php
    │       │           ├── Request.php
    │       │           └── Response.php
    │       └── tests
    │           ├── WooCommerce
    │           │   └── Tests
    │           │       ├── ClientTest.php
    │           │       └── HttpClient
    │           │           ├── BasicAuthTest.php
    │           │           ├── HttpClientExceptionTest.php
    │           │           ├── OAuthTest.php
    │           │           ├── OptionsTest.php
    │           │           ├── RequestTest.php
    │           │           └── ResponseTest.php
    │           └── bootstrap.php
    └── composer
        ├── ClassLoader.php
        ├── LICENSE
        ├── autoload_classmap.php
        ├── autoload_namespaces.php
        ├── autoload_psr4.php
        ├── autoload_real.php
        └── installed.json

11 directories, 33 files



I figured this out when I was publishing the readme for Tutor Piles on Github.

Thanks for reading. x

Resources

Print A Directory Tree On Github Readme | Ecency