MRDGH2821/Sort-Markdown-Tables · 文件
文件最后提交记录最后更新时间
README.md
Sort Markdown Tables
A zero-dependency Rust CLI tool to sort markdown tables. Tables are opted-in via <!-- smt --> HTML comments.
Features
- Opt-in sorting — Only tables marked with
<!-- smt -->are sorted - Multiple sort modes — Numeric, lexicographic (case-sensitive/insensitive), ascending/descending
- Atomic writes — Two-phase pipeline ensures zero file modifications on any error
- Glob support — Process multiple files with patterns like
docs/**/*.md - Recursive scan — Scan directories automatically with
-r - Check mode — Validate if files are sorted without modifying them
- In-place editing — Modify files directly or output to stdout
Quick Start
# Install
cargo install --git https://github.com/MRDGH2821/Sort-Markdown-Tables
# Sort in-place
smt -i README.md
# Check (CI-friendly)
smt --check README.md
Documentation
- Installation — cargo, pre-built binaries, Nix Flakes
- Usage — CLI flags, table format, sort options, exit codes
- Integrations — pre-commit, git-hooks.nix, treefmt, CI/CD
- Architecture — pipeline, algorithm, module layout, dependencies
Licence
See LICENCE.txt.
Changelog
See CHANGELOG.md.