You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -308,7 +308,7 @@ sorting-spec: |
308
308
309
309
the line `... part \d+` says: group all notes and folders with name ending with 'part' followed by a number. Then order
310
310
them by the number. And for clarity the subsequent (indented) line is added ` < a-z` which sets the order to
311
-
alphanumerical ascending.
311
+
alphabetical ascending.
312
312
313
313
The effect is:
314
314
@@ -411,6 +411,35 @@ sorting-spec: |
411
411
---
412
412
```
413
413
414
+
## Alphabetical, Natural and True Alphabetical sorting orders
415
+
416
+
The 'A-Z' sorting (visible in Obsidian UI of file explorer) at some point before the 1.0.0 release of Obsidian actually became the so-called 'natural' sort order.
417
+
For explanation of the term go to [Natural sort order](https://en.wikipedia.org/wiki/Natural_sort_order) on Wikipedia.
418
+
The plugin follows the convention and the sorting specified by `< a-z` or `> a-z` triggers the _'natural sort order'_.
419
+
420
+
To allow the true alphabetical sort order, as suggested by the ticket [27: Not alphanumeric, but natural sort order?](https://github.com/SebastianMC/obsidian-custom-sort/issues/27)
421
+
a distinct syntax was introduced: `< true a-z` and `> true a-z`
422
+
423
+
What is the difference?
424
+
Using the example from the mentioned ticket: the items '0x01FF', '0x02FF' and '0x0200' sorted in _natural order_ go as:
425
+
- 0x01FF -> the number 01 in the text is recognized
426
+
- 0x02FF -> the number 02 in the text is recognized
427
+
- 0x0200 -> the number 0200 in the text is recognized and it causes the third position of the item, because 0200 > 02
428
+
429
+
The same items when sorted in _true alphabetical_ order go as:
430
+
- 0x01FF
431
+
- 0x0200
432
+
- 0x02FF -> the character 'F' following '2' goes after the character '0', that's why 0x02FF follows the 0x0200
433
+
434
+
You can use the order `< true a-z` or `> true a-z` to trigger the true alphabetical sorting, like in the ticket:
435
+
```yaml
436
+
sorting-spec: |
437
+
target-folder: MaDo/...
438
+
> true a-z
439
+
target-folder: MaDo/Sandbox/SortingBug
440
+
< true a-z
441
+
```
442
+
414
443
## Location of sorting specification YAML entry
415
444
416
445
You can keep the custom sorting specifications in any of the following locations (or in all of them):
0 commit comments