nornir 0.4.5

Companion to cargo: dependency tracking, release gating, deploy, benchmarks, and documentation assembly. Project-agnostic.
Documentation
//! Public API surface from rustdoc JSON.
//!
//! ```bash
//! cargo +nightly rustdoc -p <crate> -- -Z unstable-options --output-format json
//! ```

use std::path::Path;
use anyhow::Result;

#[derive(Debug, Clone)]
pub struct PublicItem {
    pub path: String,
    pub kind: String,
    pub signature: Option<String>,
}

pub fn load(_rustdoc_json: &Path) -> Result<Vec<PublicItem>> {
    Ok(Vec::new())
}

pub fn to_markdown(items: &[PublicItem]) -> String {
    let mut s = String::from("| path | kind | signature |\n|---|---|---|\n");
    for i in items {
        s.push_str(&format!(
            "| `{}` | {} | {} |\n",
            i.path,
            i.kind,
            i.signature.as_deref().unwrap_or("")
        ));
    }
    s
}