Expand description
Document adapters: produce SearchDoc chunks from non-code files.
Each adapter takes a file path + raw content and returns Vec<SearchDoc>.
Adapters are intentionally thin — no deep structural parsing, just enough
text extraction to make files discoverable in asd search.
Supported file types:
- Markdown (.md, .markdown) — each H1/H2/H3 heading becomes a chunk
- Config (JSON, TOML, YAML) — key-path flattening for leaf values
- HTML (.html, .htm) — strip tags, extract title + heading text
- CSS (.css) — extract selector names and custom property names
- Manifests (Package.swift, Cargo.toml, pubspec.yaml, package.json) — extract name + description + top-level keys
- Build scripts (Makefile, Fastfile, Podfile, Gemfile) — extract target/lane names
Functions§
- adapt_
document - Detect the kind for a file path and, if recognised, parse it into chunks.
Returns
Nonewhen the file is not handled by any adapter. - is_
doc_ file - Returns true if this path should be offered to document adapters. Used to quickly gate file walking before reading content.