1.5 KiB
21. Drafts
A draft is a document of kind draft, established from a Typst project as a born-digital witness, so every sentence is F2 from the start.
Its sentences cite library sentences by address, in xref runs whose targets are addresses in other documents, and its works in cite runs whose references resolve to documents.
21.1 The snapshot
A snapshot, scienting-snapshot/1, is to a Typst draft what a lock file is to a document: a pinned, verified file the compile reads, so a draft renders offline and reproducibly.
It holds the store, when it was made, the quotes the draft cites (each an address, an anchor, the text, its fidelity and how the anchor resolved), the claims (each a reference and pin, with whatever renderings the draft uses) and the datasets (each an ID and content hash).
21.2 Sentence IDs in a draft
Authors rewrite constantly, and IDs must survive without cluttering the source.
IDs live in a sidecar, ids.jsonl in the Typst project, scienting-draft-ids/1: one line per sentence with its id, its text_hash, its section and its ord, and pinned when the author fixed the ID to a label.
Each conversion aligns the new sentences with the previous revision, exact text first and then by edit distance within the section; an edited sentence keeps its ID and gets a new hash, so its annotations reattach or go stale as 6.5 says.
Both formats are provisional (0.4).