Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing example "Specify rules for multiple folders" #140

Closed
oschrenk opened this issue Mar 6, 2024 · 2 comments
Closed

Confusing example "Specify rules for multiple folders" #140

oschrenk opened this issue Mar 6, 2024 · 2 comments

Comments

@oschrenk
Copy link

oschrenk commented Mar 6, 2024

I was trying to apply a single rule to multiple folders. And the given example is either not quite correct or I am missing some information

/
├── 01 Inbox
├── 10 Journals
│   ├── Personal
│   ├── Private
│   ├── Work
│   └── sortspec.md
...
├── 20 Projects
...

with

sorting-spec: |
    target-folder: Personal
    target-folder: Private    
    target-folder: Work
    /:files
     > a-z
    /folders
     > a-z
    sortspec

Looking at

https://github.com/SebastianMC/obsidian-custom-sort/blob/master/docs/advanced-README.md#example-8-specify-rules-for-multiple-folders

this should apply the rule but I have to relativize the target folder to make it work

sorting-spec: |
    target-folder: ./Personal
    target-folder: ./Private    
    target-folder: ./Work
    /:files
     > a-z
    /folders
     > a-z
    sortspec

Is the example not quite accurate or am I missing something?

v2.1.8

@SebastianMC
Copy link
Owner

Hi @oschrenk

the documentation of the plugin needs integration, clean up and updates. The work on it is pending slowly in the background under #66

Until then I've added a simple table of contents to the manual.md document - there is a section describing in details all the options available for target-folder: plus clarification of each. Direct link to that section: Options for target-folder: matching. Probably this makes it a bit easier to locate relevant information in the existing fragmented and scattered docs.

In short: the parameter of target-folder: is by default treated as a full path (from vault root) to the folder. So a line like target-folder: Private specifies the Private folder at root level of the vault. And if you want to use a relative path the solution is exactly what you applied.

Indeed, the examples in documentation could be confusing. Personally I would prefer to use the filesystem-paths conventions (e.g. a path not starting with '/' is treated as a relative path), yet I intentionally followed the internal conventions of Obsidian. For example, if you look how you configure some paths in Obsidian, e.g. specify folder for attachments in the UI - the name is treated as an absolute path, no prefix of '/' allowed

@oschrenk
Copy link
Author

oschrenk commented Mar 6, 2024

Thank you for the clarification. All the examples (targeting folders) assumes that the sortspec is living in root. Then it makes sense.

In the manual there is also a section that is illuminating:

https://github.com/SebastianMC/obsidian-custom-sort/blob/master/docs/manual.md#by-folder-path-the-default

Especially

target-folder: ./Some Subfolder
this refers to path of a sub-folder of the folder where the sorting specification resides (the specification containing the line, keep in mind that the sorting specification can reside in multiple locations in multiple notes)

I think I was thrown off by the comment

Personally I find convenient to keep sorting specification of all folders in a vault in a single place, e.g. in a dedicated note Inbox/Inbox.md

and I somehow assumed tfrom there hat it was always relative. But having now read more examples and more of the manual it makes sense. There are some powerful options in this plugin - thank you.

@oschrenk oschrenk closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants