Rust implementation of Laboratoria's bootcamp project md-links
.
🚧 WIP
git clone git@github.com:lupomontero/md-links-rs.git
cd md-links-rs
cargo install --path .
$ md-links-rs --help
md-links 0.1.0
Lupo Montero <lupomontero@gmail.com>
Check links in MarkDown files.
USAGE:
md-links-rs [FLAGS] <path>
FLAGS:
-h, --help Prints help information
-j, --json Show output in JSON format
-s, --stats Show stats instead of individual matches
-v, --validate Validate links (send HTTP requests)
-V, --version Prints version information
ARGS:
<path> The path to the file to read
The Rust library exposes one function:
md_links::from_path(path: &PathBuf, validate: bool) -> Vec<Link>
Example:
extern crate md_links;
let path = PathBuf::from("./some/dir");
let links = md_links::from_path(&path, false);
for link in links {
println!("{:?}", link);
}
# Dev build...
cargo build
# Release build...
cargo build --release
cargo test
- Learn Rust 🦀
- Error handling 🙈
- Mock http requests and filesystem in tests?
- Replace
println!
with a Writer and stream output instead of buffering to a string and printing at the end. - Clippy?
- Code coverage?
- Add Travis CI build
- Run requests in multiple threads?
- Request concurrency and async?
- Reorganize code in more Rust-like manner
- Persistent cache (file based)?
- Progress bar?
- Validate relative and fragment links?