-
Notifications
You must be signed in to change notification settings - Fork 76
Publicly expose the TerminalWrite
trait
#20
Conversation
Hey thanks, I'll definitely merge. Looks like Travis isn't happy, tho, can you take a look? PS: I'm very happy that you want to build something cool on top of So, expect that the API breaks when I add new features or refactor things. I hope you don't mind. PPS: I'd also appreciate help on a good API, so please feel free to open more pull requests to expose new stuff or refactor things to suite your needs. I never wrote a public Rust crate before, so I don't know much about the whole business here 😊 |
It's visible in the `push_tty` function, and should thus be exposed as well.
Sorry for the sloppiness, I really didn't expect that lint could be in my way :D! No worries about changing things around mercilessly, as long as you adhere to semver everyone using the library should be fine. As far as I am concerned, it's already doing well enough for me, as I already have something usable even without this PR. Something I found a bit odd is the performance, as it really seems to consume a lot of time during initial setup (in debug mode) - maybe it's the syntect syntax set which has to be initialized once per invocation of the As references usually add complexity, it might also be suitable to return the consumed resources as part of the |
Something I was also thinking about is if mdcat should not pretty-print things if the output is not a tty. What do you think about that? With the above trait exposed, I could also implement it that way on my end. |
@Byron Woa, cool, looks amazing 😍 I'm happy that my little thing helped you do this 😊
Thanks 😊
So… I got no idea what you're talking about here 🙈 My Rust is still pretty weak 😊 Can you elaborate a bit? Perhaps even make a pull request to optimize this? I'm really curious on how that might look like, and would love to learn more 😊
In fact, The logic for this is in |
Thanks for the hint! Actually I found it myself when I was removing all the proof-of-concept code, which was part of the problem. Something I would need to make it better is access to that now publicized trait. |
@Byron I pushed 0.8.0; made it a new minor version, since I also added (rough) SVG support for iTerm2 😃 |
Thank you! I just realized that I can't actually implement the trait myself as trait specializations have not yet landed in Rust. For me the current results are already good enough, great work there! |
It's visible in the
push_tty
function, and should thusbe exposed as well.
Maybe I am missing something, but that's the first minor bump I hit when trying to create my own implementation.