Summary
Allow users to highlight arbitrary text ranges (not limited to word boundaries) and attach notes to them. Highlights should track their target content even when the document changes, using content-based matching rather than fixed offsets.
Motivation
When reviewing or studying Markdown documents, users often want to mark specific passages and leave notes — similar to annotations in PDF readers or book margin notes. Unlike simple bookmarks, highlights need to cover arbitrary ranges and survive document edits.
Proposed Behavior
- Arbitrary range selection: Highlight any text span, not limited to words or lines
- Attach notes: Add a text memo to each highlight
- Content-aware tracking: When the document is edited and the highlighted text shifts position, use content matching (surrounding context / fuzzy match) to relocate the highlight
- Persistence: Store annotations per file (e.g. in a sidecar file or dedicated database)
- Visual display: Render highlights as background color overlays with note indicators
Technical Considerations
- Position tracking strategy: store surrounding context + highlighted text for fuzzy relocation
- Graceful degradation when content changes too drastically (mark as orphaned)
- Storage format: per-file sidecar (
.arto-annotations) or centralized DB
- Interaction with the rendered HTML view vs. source line mapping
Summary
Allow users to highlight arbitrary text ranges (not limited to word boundaries) and attach notes to them. Highlights should track their target content even when the document changes, using content-based matching rather than fixed offsets.
Motivation
When reviewing or studying Markdown documents, users often want to mark specific passages and leave notes — similar to annotations in PDF readers or book margin notes. Unlike simple bookmarks, highlights need to cover arbitrary ranges and survive document edits.
Proposed Behavior
Technical Considerations
.arto-annotations) or centralized DB