Expand description
Documents — a plaintext file with an embedded metadata block and a body, or a config file whose entire content is the metadata.
The two shapes are one model: a config file is simply a document whose
metadata carrier is the whole file and whose body is empty. Both parse to
the same Document, link through the same relations, and participate in
traversal, validation, and mutation identically — which is what lets a
workspace mix prose documents and config documents in one tree.
Structs§
- Document
- A parsed document: its path, its embedded metadata, and its body text.
Enums§
- Embed
Style - The archetype family a workspace authors embedded metadata in — the
“embed type” the CLI’s
initprompts for, one level above the concreteEmbedType. A family plus a metadatafig::Formatresolves to a carrier throughembed_carrier: e.g. (CodeBlock, YAML) is a```yamlblock, (Delimited, TOML) is a+++block, and (Separate, JSON) is a whole-file.jsonsidecar. It is what the config document records (viaprov’sWorkspaceConfig) so a workspace stays self-describing about how its metadata is embedded, not just which format it is written in. - Embed
Type - The embed archetype a fenced metadata block was found in. Re-exported from
fig, which owns both detection (fig::detect) and the fence/format coupling (EmbedType::inner_format). Which embedded config to open — the flat mirror of fig’s parametricEmbed.Type. The three parametric families (markdown---<lang>frontmatter,```<lang>fenced blocks,<script type>HTML data islands) are enumerated once per format. The first four names are historical (FrontmatterJsonis the;;;block,FrontmatterFigis the```figfenced block); the rest are grouped by container. - Meta
Carrier - Where a document’s metadata physically lives — recorded at parse time so a
write can preserve the original carrier exactly (a
```figblock is never rewritten as---YAML; a bare.yamlfile never grows fences).
Functions§
- embed_
carrier - Resolve an
EmbedStyle+ metadataformatto the carrier a new document should get.Separatemaps to a whole-file sidecar informat; every other style maps to the concreteEmbedTypefor that(style, format)pair.Nonefor a combination that has no archetype — notablyDelimited+ fig (the dialect has no----style delimiter) and any fenced style paired with a format fig cannot fence (Zon). - embed_
style_ of - The
EmbedStylefamily a concreteEmbedTypebelongs to — the inverse (on the style axis) ofembed_carrier, which resolves a(style, format)pair back to a carrier. Pairing it with a new metadata format is how a format conversion keeps a document’s embedding shape while changing only its frontmatter language: classify the current archetype, thenembed_carrierthe same style with the target format. - frontmatter_
carrier - The fenced-frontmatter carrier for
format— the archetype a new document gets when it inherits no parent block and the workspace default isformat. A format whose feature is not compiled falls back to YAML frontmatter (which the defaultyamlfeature always provides). - is_
opaque_ payload - Whether prov can read
pathas text — a recognized body format (Markdown/Djot/HTML) or a whole-file metadata format (YAML/JSON/…). Its negation is an opaque payload: a file prov treats as bytes (an image, a PDF, a font, any binary) and never parses. An attachment is exactly a whole-file metadata sidecar whosecontentpoints at such a payload, which is how an arbitrary file gains workspace-linked metadata without being able to carry frontmatter itself. - require_
whole_ file - Enforce that a record store at
path(the id registry, the recycle-bin index, a flat vocabulary) is a whole-file config document, returning its format. AMetaCarrier::Fencedcarrier — markdown frontmatter — is rejected withError::MarkdownStore: prov re-lays-out these stores as a sorted record list (DESIGN §5), so human prose has no stable home in them and unambiguous extension→format sniffing depends on the carrier being whole-file. The single choke point every store loader passes through, so the rule cannot be enforced in one place and forgotten in another. - whole_
file_ extension - The canonical whole-file extension for a metadata
format— the inverse ofwhole_file_format. Used when materializing a whole-file metadata document (a config/registry sidecar, or the metadata half of a separated document):yaml,json,figl. A format whose feature is not compiled falls back toyaml(the always-present default). - whole_
file_ format - The whole-file metadata format implied by
path’s extension, if any. These are the extensions prov treats as config documents.