Skip to content

Core Note Engine Module (NoteParser, NoteIndex, NoteGraph) #276

@ElioNeto

Description

@ElioNeto

Core Note Engine Module

Create the src/notes/ module that serves as the domain layer for note-taking functionality, wrapping the LSM engine with note-specific operations.

Components

1. src/notes/mod.rs — Module root

  • Re-export all public types
  • Define NoteEngine struct that wraps Engine<C: Cache>

2. NoteParser — Content parsing

  • Extract [[wikilinks]] from markdown content
  • Extract #tags from markdown content
  • Extract YAML frontmatter (title, aliases, tags, dates)
  • Return structured ParsedNote { content, links, tags, frontmatter }

3. NoteIndex — Index management

  • Write to link:{target} and backlink:{source} column families
  • On note update: diff old vs new links, update indexes atomically
  • On note delete: remove all link/backlink entries
  • Query: get_backlinks(path) -> Vec<String>, get_forward_links(path) -> Vec<String>

4. NoteGraph — Graph assembly for visualization

  • Traverse links/backlinks to build adjacency list
  • Return JSON structure consumable by D3.js force layout
  • Support depth-limited traversal (1-hop, 2-hop, n-hop)
  • Support filtering by tag

Acceptance Criteria

  • NoteParser correctly extracts [[wikilink]] with aliases (e.g., [[target|display]])
  • NoteParser correctly extracts #tags from content
  • NoteIndex updates indexes atomically on note writes
  • NoteIndex cleans up orphaned links on note delete
  • NoteGraph returns valid graph JSON
  • All components have unit tests > 80% coverage

Files to create

  • src/notes/mod.rs
  • src/notes/parser.rs
  • src/notes/index.rs
  • src/notes/graph.rs

Parent Epic

#275

Metadata

Metadata

Assignees

No one assigned

    Labels

    featnotesNote storage and indexingobsidianObsidian-like note-taking features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions