pub(crate) mod builder;
pub(crate) mod model;
pub(crate) mod paths;
pub(crate) mod render_single;
pub(crate) mod render_tree;

pub(crate) use builder::build_module_graph;
pub(crate) use model::ModuleGraph;
pub(crate) use model::RenderOutput;
pub(crate) use render_single::ModuleSingleRenderer;
pub(crate) use render_tree::ModuleTreeRenderer;

use anyhow::Result;

/// Renderer abstraction so layouts can be swapped without touching callers.
///
/// Implementations transform a parsed [`ModuleGraph`] into Markdown files plus
/// a SUMMARY fragment, each using their preferred layout.
///
/// This trait is internal. Users should use `render_targets()` instead.
pub(crate) trait Renderer {
    fn render(&self, graph: &ModuleGraph, out_root: &str) -> Result<RenderOutput>;
}
