/** * Markdown content processing: code-fence masking, title/description-safe * extraction, partial-import resolution, cleaning, and template assembly. */ /** * Mask fenced code blocks (``` / ~~~) and inline code spans with opaque * placeholder tokens so that content transforms — HTML/JSX stripping, import * removal, image-URL rewriting, heading detection — never alter code samples. * Returns the masked string plus a `restore()` that swaps the code back in. */ export declare function maskCodeSegments(content: string): { masked: string; restore: (s: string) => string; }; /** * Extract title from content or use the filename * @param data - Frontmatter data * @param content - Markdown content * @param filePath - Path to the file * @returns Extracted title */ export declare function extractTitle(data: any, content: string, filePath: string): string; /** * Resolve and inline partial imports in markdown content * @param content - The markdown content with import statements * @param filePath - The path of the file containing the imports * @param importChain - Set of file paths in the current import chain (for circular dependency detection) * @param siteDir - Site root, used to resolve `@site/` alias imports (defaults to process.cwd()) * @returns Content with partials resolved */ export declare function resolvePartialImports(content: string, filePath: string, importChain?: Set, siteDir?: string): Promise; /** * Clean markdown content for LLM consumption * @param content - Raw markdown content * @param excludeImports - Whether to exclude import statements * @param removeDuplicateHeadings - Whether to remove redundant content that duplicates heading text * @param preserveComponents - PascalCase component names whose tags are left untouched * @returns Cleaned content */ export declare function cleanMarkdownContent(content: string, excludeImports?: boolean, removeDuplicateHeadings?: boolean, preserveComponents?: string[]): string; /** * Create standardized markdown content template * @param title - Document title * @param description - Document description * @param content - Document content * @param includeMetadata - Whether to include description metadata * @param frontMatter - Optional frontmatter to include at the top * @returns Formatted markdown content */ export declare function createMarkdownContent(title: string, description?: string, content?: string, includeMetadata?: boolean, frontMatter?: Record): string; /** * Strip a paragraph line that exactly matches `description` — used when a * generated file already emits the description as a blockquote header, so a * body paragraph identical to it is not emitted twice. Comparison is * line-by-line with code fences skipped, so inline code stays literal: a * description containing `backticks` still matches (a regex run over masked * text would fail here, because masking also hides inline code). Only an * exact, standalone match is removed; anything else is left as written. */ export declare function stripDuplicateDescriptionParagraph(content: string, description: string): string; /** * Demote every markdown heading by one level (H1 -> H2, H2 -> H3, ...), leaving * code fences and inline code untouched. Used when a document is embedded * under a parent heading (llms-full.txt), so the document's own structure * stays nested under the parent instead of colliding with it. */ export declare function demoteHeadings(content: string): string; /** * Strip a leading heading line when its text matches `title` exactly — used * when a generated file already emits `# {title}` as its header, so the body's * own identical H1 is not emitted twice. Code fences are masked first, so a * sample beginning with the same heading is left as written. */ export declare function stripDuplicateTitleHeading(content: string, title: string): string;