Skip to content

Instantly share code, notes, and snippets.

@DenisDov
Forked from whoisryosuke/markdown-directory-tree.md
Created September 24, 2024 15:42
Show Gist options
  • Save DenisDov/1b2d27ce3250fe2db000c9990a57c663 to your computer and use it in GitHub Desktop.
Save DenisDov/1b2d27ce3250fe2db000c9990a57c663 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