Output directory structure as Markdown code block
Project description
mdtree
See below for the English version.
🔄 これは何?
mdtree は、指定したディレクトリ構造を、テキストベースのMarkdownファイルとして出力するCLIツールです。
「作ったディレクトリ構造をサクッと分かりやすく紹介したい」「プロジェクトの構成を手間なく見せたい」そんな時に使えます。
🔍 使い方
インストール
pip install mdtree-py
コマンド例
現在のディレクトリを観測:
mdtree
他のオプション例:
mdtree --path ./your_project --max-depth 2 --ignore-list node_modules .venv --no-clipboard --savepath structure.md
主なオプション
--path [PATH]: 構造を取りたいディレクトリパス指定(default:.)--max-depth [N]: 探索する最大階層を指定--ignore-list [PATTERN]: 除外したいパターンを複数指定(gitignore形式)--apply-gitignore / --no-apply-gitignore:.gitignore設定に基づく除外を適用/適用しない(default: 適用する)--exclude-git / --no-exclude-git:.gitディレクトリを除外する/しない(default: 除外する)--clipboard / --no-clipboard: 出力をクリップボードにコピーする/しない(default: コピーする)--savepath [FILE]: Markdownファイルに書き出すパスを指定(default:tree.md)--help: 使い方ヘルプを表示
✨ 便利機能
.gitignoreに基づいた除外も自動適用可能.gitディレクトリもデフォルトで除外- クリップボードへ結果を即コピペ可能
- Markdownファイルへキレイに書き出し
🎉 実施例
例えばこのリポジトリのルートで以下のように実行すると・・・
mdtree --ignore-list .DS_Store
こんな感じのコードブロックを持ったmdファイルがmdtree/tree.mdに生成されます。
また、コードブロック内のテキストがクリップボードに追加されます。
mdtree
├── .gitignore
├── LICENSE
├── README.md
├── mdtree
| ├── __init__.py
| ├── __main__.py
| ├── test
| | ├── test_cli.py
| | └── test_structure.py
| └── treebuilder.py
├── pyproject.toml
└── requirements.txt
💛 ライセンス
This project is licensed under the terms of the MIT license.
🔄 What is this?
mdtree is a CLI tool that outputs the structure of a specified directory as a text-based Markdown file.
It's perfect for situations where you want to quickly show your directory structure or easily explain the layout of your project.
🔍 How to use
Installation
pip install mdtree
Example command
Check the current directory structure:
mdtree
Other options:
mdtree --path ./your_project --max-depth 2 --ignore-list node_modules .venv --no-clipboard --savepath structure.md
Main options
--path [PATH]: Specify the directory path to inspect (default:.)--max-depth [N]: Set the maximum depth for traversal--ignore-list [PATTERN]: Specify patterns to ignore (multiple allowed, gitignore format)--apply-gitignore / --no-apply-gitignore: Apply or ignore.gitignoresettings (default: apply)--exclude-git / --no-exclude-git: Exclude or include the.gitdirectory (default: exclude)--clipboard / --no-clipboard: Copy output to clipboard or not (default: copy)--savepath [FILE]: Path to save output as a Markdown file (default:tree.md)--help: Display help
✨ Features
- Automatically apply
.gitignore-based exclusions - Exclude
.gitdirectory by default - Instantly copy results to clipboard
- Cleanly export results as a Markdown file
🎉 Example
For example, running the following command at the root of this repository:
mdtree --ignore-list .DS_Store
Generates a Markdown file mdtree/tree.md containing a code block like this, and also copies the block to your clipboard:
mdtree
├── .gitignore
├── LICENSE
├── README.md
├── mdtree
| ├── __init__.py
| ├── __main__.py
| ├── test
| | ├── test_cli.py
| | └── test_structure.py
| └── treebuilder.py
├── pyproject.toml
└── requirements.txt
💛 License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdtree_py-0.1.1.tar.gz.
File metadata
- Download URL: mdtree_py-0.1.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bde14f5cbf8f13edc72468f72b85bea58abe31d5708fd4e2398d98739da331f
|
|
| MD5 |
fd1e989a5c8aee4c800d74b97ef1593c
|
|
| BLAKE2b-256 |
130dfcb06370f44fcd5ae36e6453db8b080db041ee4921729ccdb279c0e9c730
|
File details
Details for the file mdtree_py-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mdtree_py-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7112c4226472bf65c4372ecd607743be3c1bb6a288b824b3466eb5419cfa1555
|
|
| MD5 |
e91fc844f509b6df3e2d0eb769476b2a
|
|
| BLAKE2b-256 |
1ffc151d61eb187e5cbf8e531812172a3cb320fa9d715fca21c8c3731b17f381
|