The issue #85 requires the two levels sorting.
Investigate the complexity of adding such capability.
What syntax? Using indentation (nesting) seems tempting:
// indentation-based multi-level sorting syntax (potential)
target-folder: Journal
> a-z by-metadata: date
< a-z by-metadata: time
yet this is already used to distinguish between folder-level sorting and group-level sorting. Road closed in this direction.
Also, indentation turned out to be troublesome for copy & paste of sorting spec from a web page (e.g. documentation on github) or from email. Another reason to avoid this direction.
The other (and safer) option is to involve the comma-separated list of sorting levels:
// comma-separated notation for multi-level sorting
target-folder: Journal
> a-z by-metadata: date, < a-z by-metadata: time
Before implementing this capability assess the complexity, if it is not an overkill
Take into account the existing cumbersome syntax for multi-level alike sorting:
If implementing the straight explicit multi-level sorting seems to be too complex (to be worth it), some simpler options do exist, more specific, less generic:
extension of the with-metadata: syntax to allow sorting specification at group level
technically this would generate the group identifier on-the-fly (instead of the simple number assignment) and grouping would be done based on that dynamic identifier. In result, the sorting order specification would act as a second-level sorting
generation of a compound sort-string on the fly, based on two or more metadata values, with assumption that they are numbers or dates (in number-sortable format) plus the ability to use a minus - to indicate the descending order (which is natural for negative numbers)
the syntax in this example could look like numeric by-metadata: -date, time
The assessment is done, implementation of multi-level (2-3) sorting is feasible without any significant increase in complexity, will be done under #89:
application of the multi-level sorting is simple, to be done in custom-sort.ts in a single and isolated place
parsing of the extended syntax for multi-level sorting is a bit more complex, yet it will also simplify the code in some places
the refactorings done so far under #88 help here, they introduced more abstractions in the sorting area via functional programming elements
The issue #85 requires the two levels sorting. Investigate the complexity of adding such capability.
What syntax? Using indentation (nesting) seems tempting:
yet this is already used to distinguish between folder-level sorting and group-level sorting. Road closed in this direction. Also, indentation turned out to be troublesome for copy & paste of sorting spec from a web page (e.g. documentation on github) or from email. Another reason to avoid this direction.
The other (and safer) option is to involve the comma-separated list of sorting levels:
Before implementing this capability assess the complexity, if it is not an overkill
Take into account the existing cumbersome syntax for multi-level alike sorting:
If implementing the straight explicit multi-level sorting seems to be too complex (to be worth it), some simpler options do exist, more specific, less generic:
with-metadata:
syntax to allow sorting specification at group level-
to indicate the descending order (which is natural for negative numbers)numeric by-metadata: -date, time