calternal_notes_core::notes_index
Pure projections for the rebuildable Notes Index.
Database schema and SQL stay in the host. This module maps Note text and frontmatter into stable index rows and outgoing link candidates. The Notes host resolves those candidates against files and permanent Note identities (#856, DESIGN §§9, 33).
Source: crates/calternal-notes-core/src/notes_index.rs
Structs
Section titled “Structs”IndexedLink
Section titled “IndexedLink”pub struct IndexedLinkNo doc comment.
Fields
pub value: Stringpub line: usize
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/notes_index.rs:31
IndexedTag
Section titled “IndexedTag”pub struct IndexedTagNo doc comment.
Fields
pub value: Stringpub line: usize
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/notes_index.rs:25
LinkRow
Section titled “LinkRow”pub struct LinkRowNo doc comment.
Fields
pub target_path: Stringpub referrer_path: Stringpub line: usize
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/notes_index.rs:45
NoteIndexInput
Section titled “NoteIndexInput”pub struct NoteIndexInputNo doc comment.
Fields
pub path: Stringpub title: Stringpub tags: Vec<IndexedTag>pub links: Vec<IndexedLink>
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/notes_index.rs:37
NoteIndexRow
Section titled “NoteIndexRow”pub struct NoteIndexRowNo doc comment.
Fields
pub id: Stringpub path: Stringpub title: Stringpub created: Option<String>pub last_edited: Option<String>pub tags: Vec<String>
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/notes_index.rs:15
NoteLinkIndexRow
Section titled “NoteLinkIndexRow”pub struct NoteLinkIndexRowOne source reference for incremental link-health indexing.
Fields
pub ordinal: usizepub target: LinkIndexTargetpub anchor: Option<String>: Heading slug or^block-id, without the leading#.pub raw_target: Stringpub source: Stringpub alias: Option<String>pub line: usizepub kind: LinkKind
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/notes_index.rs:72
LinkIndexTarget
Section titled “LinkIndexTarget”pub enum LinkIndexTargetA target as it appears in one stored Markdown reference.
Variants
Path(String): A Home-relative path after safe relative-path normalization.PathCandidates { source_relative: String, home_root: String, }: A CommonMark source-relative path plus the prior Home-root candidate. The host picks the existing item and keeps the other for later refresh.Wikilink(String): A title or basename that the host resolves against its Index.External: A URL or protocol reference. It is not a broken Home link.Invalid: A local reference that cannot resolve to a safe Home-relative path.
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/notes_index.rs:53
Functions
Section titled “Functions”calternal_event_link
Section titled “calternal_event_link”pub fn calternal_event_link( path: &str, indexed_title: Option<&str>, anchor: Option<&str>,) -> StringFormat an indexed target as a readable Markdown link.
Source: crates/calternal-notes-core/src/notes_index.rs:364
escape_angle_link_target
Section titled “escape_angle_link_target”pub fn escape_angle_link_target(target: &str) -> StringEscape backslashes and angle brackets for an angle-wrapped Markdown link destination (#917; DESIGN §9). This preserves destination text; it does not validate paths or percent-encode a URL.
Source: crates/calternal-notes-core/src/notes_index.rs:394
is_path_keyed_note_id
Section titled “is_path_keyed_note_id”pub fn is_path_keyed_note_id(id: &str) -> boolNo doc comment.
Source: crates/calternal-notes-core/src/notes_index.rs:277
link_rows_from_index
Section titled “link_rows_from_index”pub fn link_rows_from_index(entry: &NoteIndexInput) -> Vec<LinkRow>Convert indexed Note links into backlink rows (#917; DESIGN §9). Keep the referrer path and source line. Resolve targets with the shared Home-relative link rules and omit targets that cannot be resolved safely.
Source: crates/calternal-notes-core/src/notes_index.rs:328
link_rows_from_note
Section titled “link_rows_from_note”pub fn link_rows_from_note(path: &str, text: &str) -> Vec<LinkRow>Project standard links and wikilinks into the Notes backlink index.
Source: crates/calternal-notes-core/src/notes_index.rs:343
note_date_from_path
Section titled “note_date_from_path”pub fn note_date_from_path(path: &str) -> Option<String>Read a compact-date prefix from a canonical Note or Daily note path.
Source: crates/calternal-notes-core/src/notes_index.rs:258
note_link_index_rows_from_note
Section titled “note_link_index_rows_from_note”pub fn note_link_index_rows_from_note(path: &str, text: &str) -> Vec<NoteLinkIndexRow>Project every stored reference with enough source detail to show a precise preview and to validate its target after an Index update.
Source: crates/calternal-notes-core/src/notes_index.rs:86
note_row_from_index
Section titled “note_row_from_index”pub fn note_row_from_index(entry: &NoteIndexInput, meta: &NoteMeta) -> NoteIndexRowProject one text-index result and its frontmatter into a Note index row. Older Notes remain visible through a path-keyed synthetic row until they gain a permanent Note identity.
Source: crates/calternal-notes-core/src/notes_index.rs:284
path_keyed_note_id
Section titled “path_keyed_note_id”pub fn path_keyed_note_id(path: &str) -> StringNo doc comment.
Source: crates/calternal-notes-core/src/notes_index.rs:273
resolve_link_target
Section titled “resolve_link_target”pub fn resolve_link_target(referrer_path: &str, raw_target: &str) -> Option<String>Resolve a Note link to a vault-relative target path. Root-relative home
paths and .//../ links are resolved from the referrer; external,
absolute, empty, and above-root links are omitted from the index.
Source: crates/calternal-notes-core/src/notes_index.rs:312
slug_from_path
Section titled “slug_from_path”pub fn slug_from_path(path: &str) -> StringExtract the structural slug from a canonical Note path, or the basename for a legacy or hand-authored path.