| Crates.io | md-url-extractor |
| lib.rs | md-url-extractor |
| version | 0.1.0 |
| created_at | 2025-04-18 09:46:49.338324+00 |
| updated_at | 2025-04-18 09:46:49.338324+00 |
| description | A CLI tool for extracting, cleaning, and exporting URLs from Markdown files. |
| homepage | |
| repository | https://github.com/tonydub/md-url-extractor |
| max_upload_size | |
| id | 1639114 |
| size | 52,521 |
A tool for extracting, cleaning, and exporting URLs from Markdown files.
https://www.youtube.com/watch?v=VIDEO_ID)git clone https://github.com/tonydub/md-url-extractor.git
cd md-url-extractor
cargo build --release
The compiled binary will be available at target/release/md-url-extractor.
cargo install md-url-extractor
md-url-extractor [OPTIONS] <input_dir>
<input_dir>: Directory containing Markdown files to scan-f, --format <FORMAT>: Output format [default: stdout] [possible values: stdout, text, csv, html]-o, --output <FILE>: Output file path (required for text, csv, html formats)--domain <DOMAIN>: Filter URLs by domain--protocol <PROTOCOL>: Filter URLs by protocol [default: http https] [possible values: http, https, ftp, file, mailto]-h, --help: Show help information-V, --version: Show version informationExtract URLs from Markdown files and print to console:
md-url-extractor ~/Documents/notes/
Extract only GitHub links:
md-url-extractor ~/Documents/notes/ --domain github.com
Extract URLs and save to CSV with source information:
md-url-extractor ~/Documents/notes/ --format csv --output links.csv
Create a bookmarks file that can be imported into browsers:
md-url-extractor ~/Documents/notes/ --format html --output bookmarks.html
Extract only HTTPS links:
md-url-extractor ~/Documents/notes/ --protocol https
The following parameters are automatically removed from URLs:
utm_* parameters (utm_source, utm_medium, utm_campaign, etc.)fbclid)gclid)msclkid)ref, source)Example:
https://example.com/article?id=123&utm_source=twitter&utm_medium=socialhttps://example.com/article?id=123All YouTube URL formats are converted to the standard format:
Examples:
https://youtu.be/dQw4w9WgXcQ → https://www.youtube.com/watch?v=dQw4w9WgXcQhttps://youtube.com/embed/dQw4w9WgXcQ → https://www.youtube.com/watch?v=dQw4w9WgXcQhttps://www.youtube.com/watch?v=dQw4w9WgXcQ&t=120&feature=recommended → https://www.youtube.com/watch?v=dQw4w9WgXcQThis tool is built with a clean architecture approach:
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/your-feature-name)git commit -m 'Add some feature')git push origin feature/your-feature-name)This project is licensed under the MIT License - see the LICENSE file for details.