Skip to content

Instantly share code, notes, and snippets.

@whoisryosuke
Created July 27, 2020 21:03
Show Gist options
  • Save whoisryosuke/813186b07e6c9e4d23593041827a6530 to your computer and use it in GitHub Desktop.
Save whoisryosuke/813186b07e6c9e4d23593041827a6530 to your computer and use it in GitHub Desktop.
Markdown / Documentation - Generate Markdown-friendly directory / folder tree structure - @see: https://stackoverflow.com/a/23990108
  1. Install the Linux package tree using Homebrew: brew install tree
  2. Run the tree command on any directory to generate a Markdown friendly structure: tree your-directory

You can save it to a file by piping the results into a text file: tree . >> directory-structure.md

Example

packages/button
├── lib
│   ├── button.d.ts
│   ├── button.js
│   ├── button.js.map
│   ├── button.stories.d.ts
│   ├── button.stories.js
│   ├── button.stories.js.map
│   ├── index.d.ts
│   ├── index.js
│   └── index.js.map
├── package.json
├── src
│   ├── button.stories.tsx
│   ├── button.tsx
│   └── index.ts
└── tsconfig.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment