Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.75 KB

File metadata and controls

37 lines (25 loc) · 1.75 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Commands

npm run dev        # Development mode with esbuild watch (hot rebuild)
npm run build      # Type-check (tsc --noEmit) then production bundle

No test or lint scripts are configured.

Architecture

Single-file plugin (main.ts → compiled to main.js). All logic lives in AutoDonePlugin and a AutoDoneSettingTab class.

Core Flow

  1. Snapshot diffing — on active-leaf-change and file-open, the plugin calls takeSnapshot() to record checkbox states (line number → checked). On every editor-change, handleEditorChange() diffs the current editor against the snapshot to detect newly-checked items.
  2. Move logicmoveItemToDone() removes the checked item (+ optional sub-items via collectItemBlock()) and inserts it at the top of the ## Done section. findDoneHeadingLine() locates that heading; if absent, the section is appended.
  3. Guard flagisProcessing prevents re-entry when the plugin itself triggers editor changes during a move.
  4. Manual sweepsweepCheckedItems() command moves all currently-checked items at once.

Settings (AutoDoneSettings)

Field Default Purpose
doneHeading "Done" Heading text for the Done section
headingLevel 2 Markdown heading level (##)
moveSubItems true Include indented child items
addTimestamp false Append completion date
timestampFormat "YYYY-MM-DD" Date format string

Build Output

esbuild bundles to CommonJS (main.js), targeting ES2018, with all Obsidian/Node built-ins marked external. manifest.json controls plugin identity and min app version.