3 releases
0.1.2 | Aug 26, 2024 |
---|---|
0.1.1 | Aug 26, 2024 |
0.1.0 | Aug 26, 2024 |
#356 in Development tools
6KB
87 lines
MDXTree
A Rust command-line tool that generates a file tree structure in MDX format for use with Astro's Starlight components.
https://starlight.astro.build/guides/components/#file-tree
Features
- Generate a file tree structure from a specified directory
- Output to a file or stdout
- Option to include import statement for Starlight's FileTree component
- Respects .gitignore rules
- Handles hidden files and directories
Installation
Install from crates.io:
cargo install mdxtree
Usage
mdxtree [OPTIONS] [PATH]
Arguments:
- `PATH`: Path to generate file tree from (default: current directory)
Options:
- `-o, --output <FILE>`: Output file path (default: stdout)
- `-i, --include-import`: Include import statement for FileTree component
- `-h, --help`: Print help information
- `-V, --version`: Print version information
Example
Generate a file tree for the current directory and output to stdout:
mdxtree .
<FileTree>
- Cargo.toml
- Cargo.lock
- readme.md
- .gitignore
- src/
- main.rs
</FileTree>
License
Dependencies
~5–14MB
~166K SLoC