-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Obtain syntect Theme structs from theme name when using bat as a library #2026
Comments
Hi and thanks for the request! I think the first step here would be to replace the vendored code in the delta repo with a normal bat Cargo dependency and see how far that takes you. I'm thinking you would leave in placeholders in the code like
but otherwise get the code to compile and run. Once that is functional, we can more easily prototype what kind of API that is missing. Does that sound reasonable? |
Not that I disagree with the approach suggested by @Enselic, but to give a more direct answer: yes, I think we generally want to provide this functionality to enable Note that we currently have this notice in the documentation regarding the usage of the "expert" API (everything except for the things that are directly accessible via
Meaning that the API of (for example) |
Thanks @Enselic & @sharkdp! I've made a proof-of-principle branch in delta: dandavison/delta#903
|
Please ignore that -- this problem has gone away. So,
I will add comments to the delta PR highlighting places where I have used something from bat that is not currently exposed.
Right. I think I would still be happier responding to breaking bat expert API changes than manually updating vendored code. |
Use assets API from bat library Fixes #895 Ref sharkdp/bat#2026 Thanks @Enselic
Hi bat developers! Delta has, since the beginning, made use of bat's very helpful collection of language syntax and highlighting theme definitions. Until now, that's involved bat code vendored in the delta repo. I'd love to use the bat library for this. However, from a quick look, it appears that while the syntect syntax structs are exposed, the syntect themes are not (only theme name strings are exposed). Would it be possible (and fit with your aims) to provide an API to look up a syntect theme struct by theme name?
Thanks for all the work.
The text was updated successfully, but these errors were encountered: