Skip to main content

Crate memex

Crate memex 

Source
Expand description

memex: Generate mdBook-ready Markdown from rustdoc JSON.

Transforms rustdoc JSON output into structured Markdown files for mdBook.

§Quick Start

  1. Generate rustdoc JSON:

    cargo +nightly rustdoc --lib -- -Z unstable-options --output-format json
  2. Create memex.toml:

    [[targets]]
    crate = "my_crate"
    out = "api/my_crate"
    layout = "module-tree"
  3. Generate docs:

    use memex::{parse_targets_toml, render_targets};
    use std::{fs, path::Path};
    
    let toml = fs::read_to_string("docs/memex.toml")?;
    let targets = parse_targets_toml(
        Path::new("."),
        Path::new("docs"),
        Path::new("target/doc"),
        &toml,
    )?;
    let docs = render_targets(&targets)?;
    // Write docs.files to disk...

§Layouts

  • module-tree: Per-item pages in nested directories (like rustdoc)
  • module-single: One page per module with grouped sections

Re-exports§

pub use config::parse_targets_toml;
pub use pipeline::build_site;
pub use pipeline::build_site_with_config_path;

Modules§

agents
Tools for constructing agent-facing documentation bundles and helpers.
config
Parsing and normalization logic for memex.toml.
error
Error types used across the pipeline. Error types for memex.
pipeline
High-level orchestration pipeline for building documentation with memex.

Structs§

GeneratedDocs
Complete documentation output including all files and SUMMARY.md fragment.
GeneratedFile
A generated documentation file with its relative path and content.
TargetSpec
A configurable rendering target.

Enums§

Layout
Layout strategy per target.

Constants§

GENERATED_BANNER
Marker inserted at the top of generated Markdown files.

Functions§

render_targets
Render Markdown documentation from configured targets.
scan_targets
Auto-discover rustdoc JSON files and create targets.