Core library for ast-doc: a four-stage pipeline for generating optimized llms.txt documentation from codebases.
- Ingestion — File discovery, git metadata capture, directory tree generation
- Parser — tree-sitter AST extraction with pre-computed strategy variants
- Scheduler — Token budget optimization with intelligent degradation
- Renderer — Markdown assembly with anti-bloat rules
use ast_doc_core::{AstDocConfig, OutputStrategy, run_pipeline};
use std::path::PathBuf;
let config = AstDocConfig {
path: PathBuf::from("."),
output: None,
max_tokens: 128_000,
core_patterns: vec![],
default_strategy: OutputStrategy::Full,
include_patterns: vec![],
exclude_patterns: vec![],
no_git: false,
no_tree: false,
copy: false,
verbose: false,
};
let result = run_pipeline(&config).expect("pipeline failed");
println!("{}", result.output);| Feature | Language | Default |
|---|---|---|
lang-rust |
Rust (.rs) |
Yes |
lang-python |
Python (.py) |
No |
lang-typescript |
TypeScript/JavaScript (.ts, .tsx, .js, .jsx) |
No |
lang-go |
Go (.go) |
No |
lang-c |
C (.c, .h) |
No |
all-languages |
All of the above | No |
Apache-2.0