Skip to main content

render_note

Function render_note 

Source
pub fn render_note(
    ex: &Explanation,
    source_base: Option<&str>,
    body: Option<&str>,
) -> VaultNote
Expand description

Render a node’s Explanation into an Obsidian note: YAML frontmatter (with tags for the graph view and an ADR’s status), a clickable Source link (when source_base — a web “blob” base like https://github.com/org/repo/blob/<sha> — is known and the node has a path), the content as the knowledge base, and its edges as provenance-labelled wikilinks.

body is the node’s full source text, which only the caller can fetch: this function is a pure function of the Explanation, and an Explanation carries no repository, store or blob. When it is Some, it replaces meta.content in the note’s ## Content section — see [note_body] for why replacing is the only correct combination of the two.