Add auto-export of .note files to markdown/images - #106
Draft
philips wants to merge 1 commit into
Draft
Conversation
Watches a configurable set of vault folders and, for each .note file that appears or changes there, creates or updates a deterministic companion markdown file (and optionally images) - no manual "attach to vault" click required. Off by default, and no folder is watched until the user adds one, so enabling it doesn't churn through every .note already in the vault. - supernote-source-digest frontmatter (sha1 of the .note bytes) detects real changes across devices/sync tools without relying on mtimes, and supernote-overwrite: false lets a user opt a specific file out of future auto-regeneration after hand-editing it. - .note create/modify listeners are registered unconditionally (to catch files that synced in while Obsidian was closed, via Obsidian's startup replay of 'create' events) but only enqueue - actual conversion work is deferred until after workspace.onLayoutReady() and processed one file at a time, so Obsidian's own startup is never blocked. - .note renames patch the companion file's supernote-source-path frontmatter (and relocate it if the deterministic target path changed) instead of orphaning the reference; deleting a .note intentionally leaves generated files in place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.notefile appears or changes there - the workflow requested in Enhancement: Auto-export images/markdown to vault #41 (e.g. a folder synced from a Supernote via OneDrive/Dropbox/a symlink)..note's content via a sha1 digest stored in the generated file's frontmatter (supernote-source-digest) to detect real changes across devices without relying on mtimes, addressing the reliability concern raised in the issue thread.supernote-overwrite: falsefrontmatter lets a user opt a specific generated file out of future auto-regeneration (e.g. after hand-editing it)..notefile renames patch the companion file'ssupernote-source-pathfrontmatter (and relocate it if needed) instead of orphaning the reference. Deleting a.noteintentionally leaves previously generated files in place.create/modifylisteners are registered unconditionally (to catch the startup replay of files that synced in while Obsidian was closed) but only enqueue a reference; the actual conversion work is deferred until afterworkspace.onLayoutReady()and processed one file at a time, so this never blocks Obsidian's own startup - addressing the original concern that a prior version of this feature scanned/blocked on load.Closes #41.
Test plan
npx tsc -noEmit -skipLibCheckpassesnpx eslint .- no new errors (pre-existing warnings only)npx vitest run- 37 tests pass, including newsrc/autoExport.test.tscovering digest determinism, folder-scope matching, and the create/noop/regenerate/skip decision matrixnpm run buildsucceeds