SebastianMC / obsidian-custom-sort

Take full control over the order and sorting of folders and notes in File Explorer in Obsidian
GNU General Public License v3.0
260 stars 19 forks source link

Possible to apply sorting rules from parent folder to subfolders #1

Closed Hopsakee closed 1 year ago

Hopsakee commented 1 year ago

(first of all, many thanks for making your plugin public, I love it)

I would like to be able to automatically apply the sorting rules from a certain folder to the folder itself and its subfolders.

Something like this. --- sorting-spec: | target-folder: Reviews/... < a-z --- would custom sort the contents of the folders

Something like this --- sorting-spec: | target-folder: Reviews < a-z --- would only custom sort the contents of the folder

but would keep the following folders sorted in the standard way

craigconstantine commented 1 year ago

+1 :)

I set up the sorting I want on target-folder: /, via the correct YAML and setting the config file in the plugin's settings. I want that sort order to apply everywhere (to all folders at all levels) in my Obsidian vault.

So something like target-folder: * to say "apply this sorting to all folders everywhere".

SebastianMC commented 1 year ago

Hi @Hopsakee and @craigconstantine, thank you for your feedback and feature suggestion!

Both functionalities can be added with ease. Let me digest the idea a bit

The target-folder: * looks like an obvious addition.

The target-folder: Reviews/... as well. It would apply to subfolders which are immediate children of Reviews and maybe, following the typical approaches to similar mechanisms, there should also come target-folder: Reviews/.../... to extend the sorting rule to all descendants of Reviews.

Eventually, because of this new inheritance of sorting rules there should come a syntax to allow exclusion of some folders from the inheritance, for example:

---
sorting-spec: |
target-folder: *
< a-z
target-folder: Archive
sorting: standard
---

Let me give it some thought and not overcomplicate things

thanks again for your suggestions!

SebastianMC commented 1 year ago

Code is completed in the dedicated branch. Tested locally, new extended functionality is covered by unit tests Pending documentation update (README.md) and then release

Hopsakee commented 1 year ago

Thanks for implementing this so quickly. Awesome. If I'm not supposed to clutter the issues with 'thank you'-notes I would love to learn how to thank someone properly.

SebastianMC commented 1 year ago

Thanks for implementing this so quickly. Awesome. If I'm not supposed to clutter the issues with 'thank you'-notes I would love to learn how to thank someone properly.

You're welcome! Happy to see that the plugin is helpful!

As you can see, this plugin has just started its life as a github repository. Not so many places for communication, so a comment under an issue is ideal for communication :-)

Later on, if the communication increases (if at all), e.g. more issues or questions are raised via various channels (via new issues, via email), the 'Discussions' tab of the repository can be activated, some issues can be then transformed into discussion and vice versa.

Github is flexible and I believe there are no strict patterns.

FYI for Obsidian and plugins specifically, the active communication also goes on forums and in discord (very active!)

have a good day! Seb