-
-
Notifications
You must be signed in to change notification settings - Fork 26
How the drag'n'drop ordering can coexist with config based sorting?
The drag and drop sorting via bookmarks integration (introduced in 2.0.2 release) doesn't exclude nor overwrite any of previous capabilities of the plugin.
It seamlessly integrates with what was there before. You can sort some files, some folders, a subset of files, etc. via drag and drop, and at the same time (even within the same folder) use sortspec files
Technically, the integration with bookmarks drag'n'drop injects on-the-fly the below sorting specification:
---
sorting-spec: |
target-folder: /*
bookmarked:
< by-bookmarks-order
sorting: standard
---the specification is applied to each folder of the vault (target-folder: /*) unless an explicit sorting-spec: is used for the folder. It tells to collect bookmarked items in the top of a folder (bookmarked:) in the order reflecting bookmarks ( < by-bookmarks-order). Then goes the rest of files and folders (not bookmarked ones) ordered as selected in obsidian UI (sorting: standard).
An advanced example is to let bookmarks drag'n'drop control some files and folders in the middle of the File Explorer view of root folder, while some items above and below are steered via sortspec config:
---
sorting-spec: |
target-folder: /
Recent notes // A special note containing list of recently modified and created notes - stays pinned in the top
Inbox // Folder for notes and data requiring closer examination - let it stay in the top as well
// Then go files driven by the bookmarks drag'n'drop feature
bookmarked:
< by-bookmarks-order
// Below go meeting notes, sorted by modification date (recent go first)
/:files ...meeting notes
> modified
// Below go notes which name start with a date in the format YYYY-MM-DD, ordered by creation date
/:files \[0-9]\[0-9]\[0-9]\[0-9]-\[0-9]\[0-9]-\[0-9]\[0-9]...
> created
Archive // Archive folder and Daily notes folder go in the bottom
Daily notes
---The inline comments explain the sorting configuration sections