mdxtree

Crates.iomdxtree
lib.rsmdxtree
version0.1.2
sourcesrc
created_at2024-08-26 13:16:18.288555
updated_at2024-08-26 14:23:21.347119
descriptionA tool to generate file tree structure in MDX format for Astro's Starlight components
homepage
repositoryhttps://github.com/mayneyao/mdxtree
max_upload_size
id1352207
size18,538
Mayne (mayneyao)

documentation

README

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

MIT License

Commit count: 0

cargo fmt