automd-rs 1.0.3

It's a crate to update your README.md with your Cargo.toml, automatically. Supports badges, contributors, and with-automdrs blocks.
Documentation

automd-rs

Crates.io Version Crates.io Total Downloads docs.rs GitHub commit activity GitHub Repo stars

Keep your README.md in sync with Cargo.toml—badges, contributors, install snippets—via HTML comment blocks.

Full documentation →

Quick start

cargo add automd-rs    # as dependency
# or
cargo install automd-rs   # as CLI
automd-rs   # run in crate root

Add blocks in README.md, e.g.:

<!-- automdrs:badges version downloads docs -->
![Crates.io Version](https://img.shields.io/crates/v/automd-rs)
![Crates.io Total Downloads](https://img.shields.io/crates/d/automd-rs)
![docs.rs](https://img.shields.io/docsrs/automd-rs)
<!-- /automdrs -->

Requires repository = "https://github.com/owner/repo" in Cargo.toml.

Block types

Block Purpose
badges Crates.io version, downloads, docs.rs, GitHub stats
contributors License + contrib.rocks image
with-automdrs Footer line
cargo-add / cargo-install Add/install snippet
file Embed file content (e.g. src="./src/main.rs")

See Block Reference for options.

Library

use automd_rs::run;
run(Path::new("."), Path::new("README.md"))?;

Extend via BlockHandler trait. See API Reference.

Usage

//! CLI entry point: run from current directory (Cargo.toml + README.md).

use log::{trace, warn};
use std::path::Path;

fn main() {
    env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();

    let manifest_dir = Path::new(".");
    let readme_path = Path::new("README.md");
    trace!("manifest_dir: {:?}", manifest_dir);
    trace!("readme_path: {:?}", readme_path);

    if let Err(e) = automd_rs::run(manifest_dir, readme_path) {
        warn!("error: {}", e);
        std::process::exit(1);
    }
}

License

Published under the MIT license. Made by @YONGQI 💛


🛠️ auto updated with automd-rs