/** * The structure of a markdown page, as every build-time pass over one needs to * see it: where the frontmatter block ends, and which lines are prose rather * than fenced code. * * Both rules used to be respelled in each pass, and the copies drifted. A fence * scanner that toggles on the marker's first character alone closes a ```` * block on the ```svelte nested inside it, which pulls sample code into the * search index and sample headings into the table of contents. Keeping the * rules here means the search index, the table of contents, the LLM output and * the archive rewriter all agree on what a page's prose is. */ /** A page split at its frontmatter delimiters. */ export type MarkdownSource = { /** The YAML between the `---` lines, or undefined when the page has none. */ frontmatter: string | undefined; /** Everything after the frontmatter block: prose, headings, fenced code, tags. */ body: string; }; /** Split a page into its frontmatter and its body. */ export declare function splitFrontmatter(source: string): MarkdownSource; /** * Rewrite a page's frontmatter YAML in place, leaving the delimiters and the * body byte-identical — including their line endings, which a split-and-rejoin * would normalise. A page without frontmatter is returned untouched. */ export declare function withFrontmatter(source: string, transform: (frontmatter: string) => string): string; /** Apply `transform` to a page's prose lines, leaving fenced code untouched. */ export declare function outsideCodeFences(text: string, transform: (line: string) => string): string; /** A page's prose lines, in order, with fenced code and its markers dropped. */ export declare function proseLines(text: string): Generator; /** * The code inside each `