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§
- Manifest
Frontmatter - Strongly-typed view of MANIFEST.md’s YAML frontmatter. Mirrors the
fields produced by
stamp()so thatparse_frontmatter(stamp(&vars))round-trips cleanly. ThePartialEqderive enables round-trip assertions in tests. - Vars
- Every
{{placeholder}}in the template must be represented by a field on this struct. The frontmatter block intemplates/manifest-template.mdis the source of truth for which placeholders exist; the testtemplate_contains_all_placeholdersguards 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’supgradecommand first needs it.
Constants§
- TEMPLATE
- The
.omne/omne.mdREADME template atomne-cli/templates/omne-readme-template.md, embedded at compile time so the published binary is fully self-contained. Kept at module scope as aconstso bothstamp()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.