repo_mapper/lib.rs
1#![warn(missing_docs)]
2//! Token-budget-respecting repository map generator.
3//!
4//! Produces a compact textual summary of a source code repository by:
5//! - Extracting symbol tags (definitions and references) with tree-sitter
6//! - Building a weighted directed file-dependency graph
7//! - Running Personalized PageRank to rank files by structural relevance
8//! - Rendering ranked definitions within a token budget
9//!
10//! # Quick start
11//!
12//! ```no_run
13//! use repo_mapper::RepoMapConfig;
14//!
15//! let mut repo_map = RepoMapConfig::builder()
16//! .root("/path/to/repo")
17//! .map_tokens(1024)
18//! .build();
19//!
20//! let files = vec![std::path::PathBuf::from("/path/to/repo/src/main.rs")];
21//! let map = repo_map.get_repo_map(&[], &files, &Default::default(), &Default::default());
22//! if let Some(text) = map {
23//! print!("{text}");
24//! }
25//! ```
26
27pub mod path;
28mod tag;
29
30pub mod lang;
31pub mod parser;
32pub mod queries;
33
34pub mod extract;
35pub mod file;
36
37pub mod graph;
38pub mod weight;
39
40pub mod important;
41
42pub mod cache;
43
44pub mod rank;
45
46pub mod render;
47
48pub mod budget;
49pub mod tokens;
50
51pub mod config;
52pub mod edge_cases;
53pub mod repo_map;
54
55pub use config::{RefreshMode, RepoMapConfig, RepoMapConfigBuilder};
56pub use repo_map::RepoMap;
57pub use tag::{Tag, TagKind};