obsidian-linter
obsidian-linter copied to clipboard
FR: Key sort should respect all levels
urls:
website: ...
blog: ...
If sort order settings is Asc Alphabetical, for example, the above would become:
urls:
blog: ...
website: ...
And so on for deeper levels.
Would also apply to lists, such as tags:
.
I'm mainly referring to multi-line formatting here but I guess it makes sense for single line ss well.
@karmeye , thanks for the request. I am not sure that what you are requesting is within scope of the sort keys rule. It is designed purely for single-level sorting because trying to sort anything nested can cause problems and may not be done correctly. If we were to use a library to do so, it may be possible, but then you may lose the exception list.
Is that the intended effects?
Also, what do you mean by it should also apply to lists? A key sort only affects keys and not values, so I think I am misunderstanding something.
I was asking for nested sorting. How about setting a limit after three levels? That will cover most use cases.
If by "exceptions" you mean the "priority keys at start of yaml" setting, it's ok if only applies to the root level.
Right, lists/sequences are not keys. What I thought would be nice is to see the yaml tags and aliases sorted in alphabetical asc order.
Sorry about the delay in responding.
I am not sure on a setting for the amount of levels to sort as that will cause a recursive pain in the logic. I would much rather pass this logic off to a library to handle, but thus far I have struck out on that front.
Ok, whatever you feel is most appropriate. 👍