#file-tree #tree-structure #astro #directory-structure #mdx #command-line-tool #starlight

app mdxtree

A tool to generate file tree structure in MDX format for Astro's Starlight components

3 releases

0.1.2 Aug 26, 2024
0.1.1 Aug 26, 2024
0.1.0 Aug 26, 2024

#365 in Development tools

MIT license

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

MIT License

Dependencies

~5–14MB
~169K SLoC