Closed zhoujiayaoo closed 1 year ago
I use the following configuration
sorting-spec: | target-folder: /* /folders
true a-z
But here's what happened
I don't think that's reasonable,Thank you very much for your Chinese support.
Hi @zhou-jiayao
I tried to reproduce an equivalent example locally. Take a look at the content of sortspec
note below. I assume it is exactly the same on your computer, indentation matters - when you copied & pasted the example sortspec the indentation got lost. So the below sortspec
content is my best-guess of the specification on your machine:
---
sorting-spec: |
target-folder: /*
/folders
> true a-z
---
with that sorting specification the order of File Explorer items in my test vault is:
and for me it looks that the order of folders and files exactly matches the specification:
If you change the sorting order to (ascending) true alphabetical (change of >
into >
in the above example):
---
sorting-spec: |
target-folder: /*
/folders
< true a-z
---
you get the previous order of folders reversed:
Does this clarification help?
And let me emphasise: Obsidian itself and the custom-sort plugin directly invoke platform sorting functions and fully rely on them (the so-called Collator
). There is no internal custom code which examines the folder and notes titles to determine the order - it is delegated to the platform. I don't have much experience with Chinese and I have no idea what is the standard behavior of sorting. I believe that any system-wide customisation of locale and sorting will have influence on ordering of items in Obsidian.
If you want me to run your example on my machine, please:
[Edit] One additional question: maybe I misunderstood your request and the actual question is: can the custom sorting be based on language recognition so that you can configure 'Folder with Chinese characters go first'? If that's the question, the answer is that as of now the custom-sort plugin doesn't contain language-recognition-based capabilities. Only alphabetical (or reverse) ordering can be applied to folders and files names (which includes true alphabetical and the natural sorting orders, natural being equivalent to alphabetical in obsidian naming)
First of all, thank you very much for your reply. Your configuration here achieves exactly what I want.
But I have the same configuration as you, and it shows the following result:
That is, the file or directory with the Chinese title is always at the front, but I want it to be at the bottom, as you have implemented.
` My configuration is exactly the same as yours, and the Chinese and English names are also regular, so I won't send you the complete configuration.
Looking forward to your reply again.
Sorry, I am not good at using github reply, the format configured above is wrong, I will send it again.
sorting-spec: |
target-folder: /*
/folders
< true a-z
It looks that a kind of comment-based remote debugging session is needed :-) I suspect that your machine is configured in some way to produce the sorting order which you observe. Let's confirm that first. When I examine the vault folder from the system file explorer (which is finder app on macOS) I see the following behavior:
the above image shows alphabetical sorting by name. The second image below shows reverse alphabetical sorting by name:
as you can see, it is similar to what I observe at the Obsidian level on my side.
Could you please confirm, what you see in the system file explorer on your side? Also, when you turn off the custom-sort plugin in your vault, how the standard A-Z and Z-A sorting of Obsidian orders the folder and notes?
I'm trying to figure out if reaching the desired sorting order would require overriding of system/standard or not
Hi @zhoujiayaoo
not having further input from you since Dec '22, I'm closing the ticket. Feel free to reopen it if we can proceed
thanks, Seb
How to set the Chinese directory at the bottom and English directory at the top?