Per-instance settings
EdgeTypeLink, EdgeTypeMid, EdgeTypeEnd, and IndentSize are global variables.
- Related: https://github.com/xlab/treeprint/issues/4
It is not comfortable when one applications depends multiple components which emits tree with different format. I believe it is better to have per-instance settings.
I agree but the lib is supposed to be simple. You can wrap the API into mutex and override those global variables with each call. Or, as I suggested there - https://github.com/xlab/treeprint/issues/2#issuecomment-324944141 - reformat the tree text in post.
Idea: you can set EdgeTypeLink, EdgeTypeMid, EdgeTypeEnd, and IndentSize to be placeholders for the future replacements. I suggest using template/text tags.
FYI
Finally, I have implemented it in my fork.
It can be implemented as String() and Bytes() with options without modifing *Node more complex.
https://github.com/apstndb/treeprint/pull/1
@apstndb thanks! I've mentioned the fork in the README in the best effort to provide options for people. https://github.com/xlab/treeprint/commit/eee4a4aa121a53c4e81b37cd2a185d2167c6686e
This version stays static ;)