https://github.com/studentweis/mdref
Fast Markdown file reference finding and migration tool, written in Rust.
https://github.com/studentweis/mdref
cli markdown rust
Last synced: 4 months ago
JSON representation
Fast Markdown file reference finding and migration tool, written in Rust.
- Host: GitHub
- URL: https://github.com/studentweis/mdref
- Owner: StudentWeis
- License: mit
- Created: 2025-09-10T14:06:13.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-10-13T03:22:55.000Z (9 months ago)
- Last Synced: 2025-12-21T20:20:45.589Z (7 months ago)
- Topics: cli, markdown, rust
- Language: Rust
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
Awesome Lists containing this project
README
**_mdref_**
[](https://crates.io/crates/mdref)
A fast, Rust-based tool for discovering and migrating Markdown references — it processed 155 directories and 1,561 files in just 0.1 seconds. Support search by file or directory.
> [!CAUTION]
> This project is still in early development, and some features may not be fully functional. Please use it with caution and report any issues you encounter.
# Basic Usage
## Install & Update
Install prebuilt binaries via shell script:
```sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/studentweis/mdref/releases/download/0.3.6/mdref-installer.sh | sh
```
Install prebuilt binaries via powershell script
```sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/studentweis/mdref/releases/download/0.3.6/mdref-installer.ps1 | iex"
```
Update mdref:
```sh
mdref-update
```
## Basic command
- find 🔍:Find all markdown references in the specified directory.
- mv 🔥:Move file and update markdown references.
- rename 🔄:Rename file and update markdown references.
```sh
$ mdref find ./examples/main.md
References to ./examples/main.md:
./examples/inner/sub/other.md:3:1 - ../../main.md
./examples/other.md:7:1 - main.md
./examples/inner/other.md:3:1 - ../main.md
./examples/main.md:7:1 - main.md
./examples/inner/sub/main.md:3:1 - ../../main.md
./examples/inner/main.md:3:1 - ../main.md
Links in ./examples/main.md:
./examples/main.md:3:2 - main.jpg
./examples/main.md:5:2 - main.jpg
./examples/main.md:7:1 - main.md
./examples/main.md:7:25 - inner/main.md
./examples/main.md:7:55 - inner/sub/main.md
./examples/main.md:9:1 - other.md
./examples/main.md:9:27 - inner/other.md
./examples/main.md:9:59 - inner/sub/other.md
```
# Todo
- [ ] More tests.
- [ ] Directory path support.
- [ ] Fix the case of link path with space.
- [ ] VSCode extension.
- [ ] Preview mode of mv command.
- [ ] More documentations.
- [ ] Cargo-dist oranda homepage.
# Acknowledge
- clap
- walkdir
- pathdiff
- regex
- rayon
- cargo-dist
# Contributing
If you want to submit code to this repository, please first refer to [CONTRIBUTING](./CONTRIBUTING).
Thanks for your help!