ast-doc-core 0.1.0

Core library for ast-doc: four-stage pipeline for generating optimized llms.txt documentation
Documentation

ast-doc-core

crates.io docs.rs

Core library for ast-doc: a four-stage pipeline for generating optimized llms.txt documentation from codebases.

Pipeline

  1. Ingestion — File discovery, git metadata capture, directory tree generation
  2. Parser — tree-sitter AST extraction with pre-computed strategy variants
  3. Scheduler — Token budget optimization with intelligent degradation
  4. Renderer — Markdown assembly with anti-bloat rules

Usage

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 Flags

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

License

Apache-2.0