Ordered tags
Feature Description
It's just a QOL feature, but I would like to have the program to be able to either automatically or on a button press sort the tags inside the svg elements.
What I mean is like if you have:
<elm d="..." fill="..." class="...">
<elm class="..." fill="..." d="...">
<elm fill="..." class="..." d="...">
it would sort it to
<elm class="..." d="..." fill="...">
<elm class="..." d="..." fill="...">
<elm class="..." d="..." fill="...">
This could either be some user preset or just look at the most used method for sorting and go with that, and would need some way of handling unknown tags (the go with most used sort in the code looks good for that). The 2 ideas can even be combined and have manual sorting for some tags and auto sort the rest!
Good idea! I honestly want to have something more sophisticated than basic alphabetic sorting, I've just not figured out the full details of what exactly.
Well the way I thought of would be this (my personal opinion only because you asked):
Have some settings title, possibly in its own settings tab with the following in it:
- Dropdown for automatic sorting; either on save, on edit or never
- Dropdown for handling tags not stated below; either leave where they are, sort alphabetically up or down, or sort based on most common order in the file (leaving it if it's impossible to decide)
- Maybe a checkbox for whether to display the manual sort button or not?
- A box with some draggable text just like the palletes but with text instead of colours (I just realised how cool that is) with the plus button for new text instead of new colour
And have a button (maybe next to the optimise button on the main screen?) that sorts the tags.
This is just how I would do it, you can do it this way if you want to. If I had any free time I would probably code this myself but unfortunately I have 0 free time for the next 3 weeks.
I won't know until I start working on it, but I think it should just be a setting in the existing formatters. I'm currently working on a major rework to the inspector, so I won't work on this anytime soon.
I did think that but the 'formatting' settings heading is quite large, if you broke it up that would work better but that's tricky with the presets and 2 different formatters