From 5b9a806af13d38163156302097e405a7b145b6cc Mon Sep 17 00:00:00 2001 From: JSDurand Date: Thu, 19 Nov 2026 09:29:47 +0800 Subject: elel: notes engine (Rust) and Gnus-like Emacs frontend Tantivy full text index, link graph, inline query filters, Ollama embeddings with paragraph chunks, and an Elisp summary/article UI. Co-Authored-By: Claude Sonnet 5.5 --- src/note.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/note.rs (limited to 'src/note.rs') diff --git a/src/note.rs b/src/note.rs new file mode 100644 index 0000000..ef38094 --- /dev/null +++ b/src/note.rs @@ -0,0 +1,36 @@ +//! The data model shared by all adapters and by the index. + +use serde::{Deserialize, Serialize}; + +/// A link from one note to another. Types are optional. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Link { + pub dst: String, + pub kind: Option, +} + +/// One note. A file is a container of notes; the note is the unit. +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct Note { + /// `None` for a note that has no ID yet; `check` reports these. + pub id: Option, + pub path: String, + /// Byte span of the note inside its file. + pub start: usize, + pub end: usize, + /// 1-based line number of the first line of the note. + pub line: usize, + /// Hash of the span, used to detect changed notes. + pub hash: String, + pub title: String, + pub date: Option, + pub kind: Option, + pub tags: Vec, + pub parent: Option, + pub links: Vec, + pub context: Option, + pub summary: Option, + /// The text to index. It is never written to the manifest. + #[serde(skip)] + pub body: String, +} -- cgit v1.2.3-18-g5258