followMove
uses Buffer
After the file from moved to to: the pages whose links change, as new definitions, by name.
import type { Codebase } from "#codebase/tcmts/cli/codebase"; import { fileDefinition, filesIn, relinked } from "#codebase/tcmts/cli/files"; import type { DefRecord } from "#codebase/tcmts/core/types"; export function followMove(cb: Codebase, from: string, to: string): Map<string, DefRecord> { const out = new Map<string, DefRecord>(); for (const [page, rec] of filesIn(cb, "")) { const text = relinked(cb, page, rec, from, to); if (text !== undefined) out.set(page, fileDefinition(cb, page, "md", Buffer.from(text, "utf8")).def); } return out; }
uses
- tcmts.cli.codebase.Codebase
- tcmts.cli.files.fileDefinition
- tcmts.cli.files.filesIn
- tcmts.cli.files.relinked
- tcmts.core.types.DefRecord