Skip to content

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

pub struct IndexedLink

No doc comment.

Fields

  • pub value: String
  • pub line: usize

Implements: Debug, Clone, PartialEq, Eq

Source: crates/calternal-notes-core/src/notes_index.rs:31

pub struct IndexedTag

No doc comment.

Fields

  • pub value: String
  • pub line: usize

Implements: Debug, Clone, PartialEq, Eq

Source: crates/calternal-notes-core/src/notes_index.rs:25

pub struct LinkRow

No doc comment.

Fields

  • pub target_path: String
  • pub referrer_path: String
  • pub line: usize

Implements: Debug, Clone, PartialEq, Eq

Source: crates/calternal-notes-core/src/notes_index.rs:45

pub struct NoteIndexInput

No doc comment.

Fields

  • pub path: String
  • pub title: String
  • pub tags: Vec<IndexedTag>
  • pub links: Vec<IndexedLink>

Implements: Debug, Clone, PartialEq, Eq

Source: crates/calternal-notes-core/src/notes_index.rs:37

pub struct NoteIndexRow

No doc comment.

Fields

  • pub id: String
  • pub path: String
  • pub title: String
  • pub 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

pub struct NoteLinkIndexRow

One source reference for incremental link-health indexing.

Fields

  • pub ordinal: usize
  • pub target: LinkIndexTarget
  • pub anchor: Option<String>: Heading slug or ^block-id, without the leading #.
  • pub raw_target: String
  • pub source: String
  • pub alias: Option<String>
  • pub line: usize
  • pub kind: LinkKind

Implements: Debug, Clone, PartialEq, Eq

Source: crates/calternal-notes-core/src/notes_index.rs:72

pub enum LinkIndexTarget

A 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

pub fn calternal_event_link(
path: &str,
indexed_title: Option<&str>,
anchor: Option<&str>,
) -> String

Format an indexed target as a readable Markdown link.

Source: crates/calternal-notes-core/src/notes_index.rs:364

pub fn escape_angle_link_target(target: &str) -> String

Escape 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

pub fn is_path_keyed_note_id(id: &str) -> bool

No doc comment.

Source: crates/calternal-notes-core/src/notes_index.rs:277

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

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

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

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

pub fn note_row_from_index(entry: &NoteIndexInput, meta: &NoteMeta) -> NoteIndexRow

Project 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

pub fn path_keyed_note_id(path: &str) -> String

No doc comment.

Source: crates/calternal-notes-core/src/notes_index.rs:273

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

pub fn slug_from_path(path: &str) -> String

Extract the structural slug from a canonical Note path, or the basename for a legacy or hand-authored path.

Source: crates/calternal-notes-core/src/notes_index.rs:240