Expand description
Markdown → Entity parser. Handles YAML frontmatter, sections, wiki-links.
Key design decisions:
- Hand-rolled YAML frontmatter parser (NOT serde_yaml) to match JS type coercion
- Code blocks are masked before section/link detection to prevent false matches
- The parser is schema-aware: it uses the schema to determine catch-all sections
Structs§
- Wiki
Link - A wiki-link found in markdown content.
Enums§
Functions§
- compute_
hash - Compute SHA-256 hash of content, truncated to 16 hex characters.
- extract_
inline_ links_ lenient - Permissive sibling of [
extract_inline_links] for read-side scanners. Decodes every[[...]]token viawiki_link_to_id_lenientso on-disk drift (legacy entities, archive-imports from pre-strict engines, partial-mutation rollbacks) keeps flowing through dangling- link reporters and graph inspectors. Mutation paths MUST NOT use this helper — see [extract_inline_links] for the strict variant. - extract_
wiki_ links - Extract all wiki-links from markdown content.
- mask_
code_ blocks - Mask fenced code blocks by replacing content with spaces (preserves line count and offsets). Handles unclosed code blocks safely — they mask to end of text.
- parse_
file - Parse an entity from a file on disk.
- parse_
markdown - Parse a markdown string into an Entity.
- peek_
title_ and_ type - Peek the entity title (first
#heading in the body) and type (type:frontmatter field) from raw markdown without running the full schema-aware parser. Used by surfaces that read a markdown blob outside the in-memory store — e.g.memstead_diffwalking git trees between two arbitrary refs, where the store snapshot (current HEAD) is not a valid source for a non-HEAD ref. ReturnsNonefortitlewhen the body carries no#heading andNoneforentity_typewhen the frontmatter lacks a non-emptytype:. - peek_
type_ from_ frontmatter - Extract the
type:value from frontmatter without running the full parser.