Giter Site home page Giter Site logo

md-links-rs's Introduction

md-links-rs

Rust implementation of Laboratoria's bootcamp project md-links.

๐Ÿšง WIP

Installation

git clone [email protected]:lupomontero/md-links-rs.git
cd md-links-rs
cargo install --path .

Usage

CLI

$ md-links-rs --help
md-links 0.1.0
Lupo Montero <[email protected]>
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

Rust

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);
}

Build

# Dev build...
cargo build

# Release build...
cargo build --release

Tests

cargo test

TODO

  • 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?

md-links-rs's People

Contributors

lupomontero avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.