Skip to content

folder-note

The folder-note concept: which note, if any, is the one whose properties describe a FOLDER itself.

Obsidian has no such concept — it is a convention the community settled on, and the plugin that owns it for most vaults is folder-notes. So the answer to “which note belongs to this folder” is that plugin’s to give whenever it is installed, and this module asks it rather than inventing a second answer: FolderNoteLocation.Auto — the default — reads its live configuration at every use.

Reading it live rather than copying its values into a consumer’s own settings is deliberate: a copy goes stale the moment that plugin is reconfigured, and it would need a settings migration to seed. Everything else is the caller’s explicit choice, and then the other plugin is not consulted at all.

Nothing here ever CREATES a note. A folder with no folder note answers null, which is what lets a caller layer folder-note behavior onto a click without risking a file appearing on the user’s disk.

Interface Description
FolderNoteConfig A folder-note setup with FolderNoteLocation.Auto already resolved to a concrete answer.
ResolveFolderNoteConfigParams Parameters for resolveFolderNoteConfig.
ResolveFolderNoteParams Parameters for resolveFolderNote.
Function Description
resolveFolderNote Finds a folder’s folder note — the one note whose properties describe the folder itself. Never creates. A folder that has no folder note answers null, and so does the vault root under FolderNoteLocation.ParentFolder (nothing can sit beside it).
resolveFolderNoteConfig Resolves FolderNoteLocation.Auto into a concrete folder-note setup. folder-notes’ vaultFolder storage (every folder note pooled in one central folder) has no counterpart here and falls back rather than guessing: with the notes pooled, the note belonging to a folder is no longer derivable from that folder’s path alone.
Enum Description
FolderNoteLocation Where a folder’s folder note lives. The three concrete members are the shapes the folder-note ecosystem actually uses: charlie/charlie.md and charlie/index.md are both FolderNoteLocation.InsideFolder (they differ only in the NAME, which is why naming is a callback and not a fourth member), while charlie.md beside the folder is FolderNoteLocation.ParentFolder — whose whole point is that [[alpha/bravo/charlie]] links to a folder with no special syntax.
Variable Description
FOLDER_NOTES_PLUGIN_ID The folder-notes plugin’s id, as its manifest declares it.