/** * Dependency-free HTML → readable Markdown-ish text (RCL-01). * * WHY NO DEPENDENCY — the capture path has to work in an `npx monomind` * install with nothing extra resolved, and the extension already runs * Readability against the live DOM. What lands here is the fallback for an * archive nobody cleaned: a small, predictable extractor beats a large one we * cannot install. * * WHY BOILERPLATE STRIPPING IS THE POINT — a site's nav, header, footer and * cookie banner are byte-identical on every page. Leave them in and every * document from that site chunks into near-identical text, so their embeddings * cluster on the chrome rather than the article and recall collapses. Dropping * a little real content is a far cheaper error than keeping the chrome. * * @module v1/cli/knowledge/html-extract */ import { decodeEntities } from './html-tags.js'; export { decodeEntities }; export interface HtmlExtractOptions { /** Drop nav/header/footer/aside/cookie-banner containers. Default true. */ stripBoilerplate?: boolean; } export interface ExtractedHtml { /** `` text, or null when the document has none. */ title: string | null; /** Markdown-ish body text; headings as ATX, list items as `- `. */ text: string; } /** * Parse `html` into a title and clean block text. * * Unbalanced markup is expected — real archives are full of it — so closing a * tag pops back to its last matching open and a never-closed element simply * stays open until its parent closes. Nothing here throws. */ export declare function extractHtmlDocument(html: string, opts?: HtmlExtractOptions): ExtractedHtml; /** * Clean text for an HTML document, with the `<title>` promoted to an `# h1` * when the page has no top-level heading of its own. */ export declare function htmlToMarkdown(html: string, opts?: HtmlExtractOptions): string; //# sourceMappingURL=html-extract.d.ts.map