Skip to content
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

Syntax highlighting for code snippets #45

Open
alexzanderr opened this issue Apr 6, 2022 · 4 comments
Open

Syntax highlighting for code snippets #45

alexzanderr opened this issue Apr 6, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@alexzanderr
Copy link

have you thought to use bat to print highlighted source code ?

like this
image

can i make a pull request with this idea ?

@bjorn3
Copy link

bjorn3 commented Apr 6, 2022

Bat uses syntect for syntax highlighting I believe.

@athre0z athre0z changed the title question Syntax highlighting for code snippets Apr 6, 2022
@athre0z
Copy link
Owner

athre0z commented Apr 6, 2022

I considered it, but I refrained from doing it because I didn't want to pull in the required dependencies. I'd however accept it as a PR if it was implemented as a default-disabled, optional feature of the crate. Like @bjorn3 suggested, I think it would be best to use syntect instead of going through bat.

@athre0z athre0z added the enhancement New feature or request label Apr 6, 2022
@alexzanderr
Copy link
Author

Bat uses syntect for syntax highlighting I believe.

indeed, i was meaning syntect in the background, not bat.

@alexzanderr
Copy link
Author

ate. Like @bjorn3 suggested, I think it would be best to use syntect instead of going through bat.

very nice. yes, ofc, i will use syntect, only the library for syntax highlighthing.

in that example i was using bat's api because i was trying to achieve the result fast to see if its working.

but when im going to optimise it, i will use syntect only, which will be much much faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants