Skip to content

calternal_notes_core::composer

One-line composer parser. Explicit Log prefixes use the Daily note parser; other natural times and Tags use exact source spans so title words stay put.

Source: crates/calternal-notes-core/src/composer.rs

pub struct ComposerEntry

Parsed log entry fields. start uses the host-provided current time when the line has no explicit time.

Fields

  • pub start: String
  • pub end: Option<String>
  • pub title: String
  • pub tags: Vec<String>

Implements: Debug, Clone, PartialEq, Eq

pub fn into_log_entry(self) -> LogEntry

Consume the Composer result as a new Log entry (#917; DESIGN §38). Keep start, end, title, and Tags. LogEntry::new supplies an empty identity and attachments, with no place or time zone.

Source: crates/calternal-notes-core/src/composer.rs:11

pub struct ComposerParse

Full composer projection. It keeps the familiar Log entry fields and adds the date and classification signals used by task and reminder capture.

Fields

  • pub start: String
  • pub end: Option<String>
  • pub title: String
  • pub tags: Vec<String>
  • pub date: Option<String>
  • pub since: Option<String>
  • pub until: Option<String>
  • pub duration_minutes: Option<u32>
  • pub mode: String
  • pub crosses_midnight: bool

Implements: Debug, Clone, PartialEq, Eq

pub fn into_log_entry(self) -> LogEntry

Consume the Composer result as a new Log entry (#917; DESIGN §38). Keep start, end, title, and Tags. LogEntry::new supplies an empty identity and attachments, with no place or time zone.

Source: crates/calternal-notes-core/src/composer.rs:21

pub struct ComposerSplit

No doc comment.

Fields

  • pub title: String
  • pub body: String

Implements: Debug, Clone, PartialEq, Eq

Source: crates/calternal-notes-core/src/composer.rs:35

pub struct NoteTitleTags

No doc comment.

Fields

  • pub title: String
  • pub tags: Vec<String>

Implements: Debug, Clone, PartialEq, Eq

Source: crates/calternal-notes-core/src/composer.rs:41

pub fn note_title_tags(line: &str) -> NoteTitleTags

Strip every Tag token from a Note title line. Time-shaped numbers remain title text because Notes do not consume event or Task recognizers. Values dedupe in NFC form, while every source span is removed (#473).

Source: crates/calternal-notes-core/src/composer.rs:81

pub fn parse_composer(input: &str, now: &str) -> ComposerParse

Parse one composer line through the full reference NLP pipeline.

The JavaScript composer commits an entry to the current Daily note when no time token appears. This adapter therefore uses the time from the supplied now value while retaining the same date as the default day. It does not read the process clock. Explicit leading Log times use the Daily note grammar so imports, previews and writes agree (#724).

Source: crates/calternal-notes-core/src/composer.rs:225

pub fn parse_composer_entry(input: &str, now: &str) -> ComposerEntry

Parse one natural-text composer line.

Source: crates/calternal-notes-core/src/composer.rs:140

pub fn split_composer_input(text: &str) -> ComposerSplit

Split a multi-line capture into its first non-blank title line and body. CRLF and CR are normalized before the body is trimmed at blank edges.

Source: crates/calternal-notes-core/src/composer.rs:48

pub fn suggest_log_line(raw: &str) -> Option<String>

Suggest a canonical Log line for a malformed top-level Log bullet.

A suggestion needs an explicit time and a non-empty title. A missing time would make the parser use the current clock, which is unsafe for repair.

Source: crates/calternal-notes-core/src/composer.rs:200