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

Add syntax highlighting #23

Open
pjamargh opened this issue Mar 12, 2021 · 1 comment
Open

Add syntax highlighting #23

pjamargh opened this issue Mar 12, 2021 · 1 comment

Comments

@pjamargh
Copy link

It would be great to have syntax highlighting shown on the results (depending on the extensions).

Maybe is possible to leverage https://github.com/simonw/datasette-render-markdown and its Markdown engine's https://python-markdown.github.io/extensions/code_hilite/ extension to display that. Something like ripgrep > recognize files pieces > mardown with code blocks > datasette-render-markdown.

Thanks!

@pjamargh
Copy link
Author

I just found out another fast tool to generate syntax highlighted output (https://github.com/sharkdp/bat) has specific integration with ripgrep (see https://github.com/eth-p/bat-extras/blob/master/doc/batgrep.md). As it does not have html output you would still have to convert the result with ANSI's color to html.

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

No branches or pull requests

1 participant