-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
PrettyPrint wrapper, custom 'Read' input, bugfixes, major refactoring #936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@dandavison Would an API like this work for |
This looks great! However, regarding delta, the only things it uses from bat are the pager spawning code ( |
I see. Than you for the clarification. |
This is a major update of "bat as a library". I have implemented a new
PrettyPrinter
struct which is a builder-like wrapper to configure and control the pretty-printing process. I tried to make it similar toprettyprint::PrettyPrinter
by @mre, but it will not be a drop-in replacement, unfortunately.Major new functionality: the
bat
library can now accept arbitraryRead
ers as input. This also includes input from a (byte) string.Here are a few examples of how the library can be used (see
examples
folder for more):simple.rs
cat.rs
yaml.rs
advanced.rs
closes #884
closes #937
closes #729
closes #730