asciitree icon indicating copy to clipboard operation
asciitree copied to clipboard

Handle first child specially

Open jakirkham opened this issue 6 years ago • 5 comments

Closes https://github.com/mbr/asciitree/issues/10

Adds first_child_head and first_child_tail to Style and implements them in a compatible way for BoxStyle. Updates LeftAligned to handle the first child with these special methods.

jakirkham avatar Oct 25 '17 03:10 jakirkham

Still need to resolve the case of having only one child. Namely does it go through first or last or possibly both and why.

jakirkham avatar Oct 25 '17 03:10 jakirkham

Made the only child case a special case that can also be overridden.

jakirkham avatar Oct 25 '17 03:10 jakirkham

Also updated all styles to define these functions in a way that is compatible with their existing behavior.

jakirkham avatar Oct 25 '17 03:10 jakirkham

While this technically works and passes the tests, I'm not sure that it is helpful for solving my problem yet. Am trying to generate some HTML and CSS to make a visualization like this one (item 4) The code being generated needs to look something like this, but was having a hard time getting that behavior out of these functions. Ended up rolling my own function, but it would be better if that wasn't necessary.

jakirkham avatar Oct 25 '17 17:10 jakirkham

Opened issue ( https://github.com/mbr/asciitree/issues/12 ) based on the last point. Namely handling cases of having or not having children specially.

jakirkham avatar Oct 25 '17 17:10 jakirkham