Closed gdesmar closed 4 months ago
If you were curious to see what difference the agnostic+yaml changes makes in the output (and the code 😨), I uploaded a new branch with it. I tried to stick as closely to the original for the early print levels, such that level 1 are not nice'd but has a colon, level 2 are not nice'd and no colon, while other levels are nice'd and has a colon. It was an interesting journey. 😃
I modified the Unknown block to not use a property, since none of the other block does. I regenerated the tests to pass, and realized you already had a file with data following the Terminal block, so I added it also as a txt output test.
Regarding text output, I modified the print_lnk_file function to fit the current coding style, but I'm not a fan of hard-coding keys for which there is different behaviour. I went down a very deep rabbit hole to make it all agnostic. It would make those hard-coded list items re-use their parent instead: being the index, and
Serialized property values
having manyProperty
under it, in the agnostic first version, those got transformed fromProperty:
toSerialized property values - <N>:
withStorage:
underProperty store:
toProperty store - <N>:
, thinking that now any list would be handled. I then decided that the extra layers for lists were long and probably not needed and did something similar to yaml where list items have a-
in front. It's nice looking but the code got a little complicated, I would rather open a new PR if I was to offer it. :D There is one little tweak I did in the text output, for the nice_id, it will uppercase the key name if it's a hash algorithm, so that SHA256 does not show up as Sha256.