How do you print lib structure?

how to print lib structures like this

lib
├── my_project
│ ├── application.ex
│ ├── repo.ex
│ └── vendors
│ ├── devices.ex
│ └── vendors.ex
├── my_project.ex
├── my_project_web
│ ├── channels
│ │ └── user_socket.ex
│ ├── controllers
│ │ ├── page_controller.ex
│ │ └── vendor
│ │ └── devices_controller.ex
│ ├── endpoint.ex
│ ├── gettext.ex
│ ├── router.ex
│ ├── templates
│ │ ├── layout
│ │ │ └── app.html.eex
│ │ ├── page
│ │ │ └── index.html.eex
│ │ └── vendor
│ │ └── devices
│ │ ├── edit.html.eex
│ │ ├── form.html.eex
│ │ ├── index.html.eex
│ │ ├── new.html.eex
│ │ └── show.html.eex
│ └── views
│ ├── error_helpers.ex
│ ├── error_view.ex
│ ├── layout_view.ex
│ ├── page_view.ex
│ └── vendor
│ └── devices_view.ex
└── my_project_web.ex

What do you consider a lib structure? When you print it, what do you expect it to look like?

But you can print almost all data easily by usingIO.inspect.

I mean like this

lib
├── my_project
│ ├── application.ex
│ ├── repo.ex
│ └── vendors
│ ├── devices.ex
│ └── vendors.ex
├── my_project.ex
├── my_project_web
│ ├── channels
│ │ └── user_socket.ex
│ ├── controllers
│ │ ├── page_controller.ex
│ │ └── vendor
│ │ └── devices_controller.ex
│ ├── endpoint.ex
│ ├── gettext.ex
│ ├── router.ex
│ ├── templates
│ │ ├── layout
│ │ │ └── app.html.eex
│ │ ├── page
│ │ │ └── index.html.eex
│ │ └── vendor
│ │ └── devices
│ │ ├── edit.html.eex
│ │ ├── form.html.eex
│ │ ├── index.html.eex
│ │ ├── new.html.eex
│ │ └── show.html.eex
│ └── views
│ ├── error_helpers.ex
│ ├── error_view.ex
│ ├── layout_view.ex
│ ├── page_view.ex
│ └── vendor
│ └── devices_view.ex
└── my_project_web.ex

The command line program “tree” will do that for you :slight_smile:

2 Likes