@apideck/docs-mcp
Version:
MCP server that lets agents search and retrieve your documentation at query time instead of relying on stale training data.
35 lines • 1.7 kB
TypeScript
export interface ParsedFrontmatter {
data: Record<string, unknown>;
body: string;
hasFrontmatter: boolean;
}
export declare const parseFrontmatter: (raw: string) => ParsedFrontmatter;
/** GitHub-style heading anchors. */
export declare const slugify: (text: string) => string;
export interface RawSection {
heading: string;
level: number;
anchor: string;
headingPath: string[];
content: string;
startLine: number;
}
/**
* Split a markdown body on ATX headings. Headings inside fenced code blocks are
* ignored. The preamble (text before the first heading) becomes a level-0
* section when non-empty.
*/
export declare const splitSections: (body: string) => RawSection[];
/** Relative link targets in the body. Images, external, mailto and pure-anchor links are skipped. */
export declare const extractLinks: (body: string) => string[];
/** Reduce markdown to readable plain text, for snippets and word counts. */
export declare const toPlainText: (md: string) => string;
export declare const countWords: (md: string) => number;
export declare const titleFromPath: (path: string) => string;
/** Frontmatter `title`, else the first H1, else a title derived from the filename. */
export declare const deriveTitle: (frontmatter: Record<string, unknown>, sections: RawSection[], path: string) => string;
/** A parseable date from frontmatter, if present. */
export declare const frontmatterDate: (frontmatter: Record<string, unknown>) => Date | null;
/** Short excerpt around the first query term hit, or the start of the text. */
export declare const makeSnippet: (plain: string, terms: string[], width?: number) => string;
//# sourceMappingURL=markdown.d.ts.map