Skip to main content

Module manifest

Module manifest 

Source
Expand description

.omne/omne.md README template embedding, stamping, and frontmatter parsing.

The template lives at omne-cli/templates/omne-readme-template.md and is embedded into the binary at compile time via include_str!, so the shipped binary carries no companion files. The v2 design demoted the old MANIFEST.md bootloader hop to a non-loaded README at .omne/omne.md; this module stamps that file. Stamping is a pure placeholder-replacement operation. Parsing splits the file on --- frontmatter fences, extracts the YAML block, deserializes via serde_yml, and returns a strongly-typed ManifestFrontmatter struct. Missing required fields surface as Error::MissingField { field } rather than generic YAML errors so upgrade can print an actionable remediation hint.

Structs§

ManifestFrontmatter
Strongly-typed view of MANIFEST.md’s YAML frontmatter. Mirrors the fields produced by stamp() so that parse_frontmatter(stamp(&vars)) round-trips cleanly. The PartialEq derive enables round-trip assertions in tests.
Vars
Every {{placeholder}} in the template must be represented by a field on this struct. The frontmatter block in templates/manifest-template.md is the source of truth for which placeholders exist; the test template_contains_all_placeholders guards that contract.

Enums§

Error
Errors produced by this module. Wrapped at the top level via a CliError::Manifest(#[from] manifest::Error) variant which lands when Unit 9’s upgrade command first needs it.

Constants§

TEMPLATE
The .omne/omne.md README template at omne-cli/templates/omne-readme-template.md, embedded at compile time so the published binary is fully self-contained. Kept at module scope as a const so both stamp() and the test module can reference it.

Functions§

parse_frontmatter
Parse the ---...--- YAML frontmatter at the top of a MANIFEST.md document into a strongly-typed struct.
stamp
Render the embedded template with the provided variables.