-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use alecthomas/chroma for syntax highlighting #15
Comments
Hi @BoGeM, thanks for the question/suggestion. I've heard of that library and looked at it briefly. At a glance, it seems to offer a lot of functionality. I personally don't need support for highlighting many other languages, and the existing highlighting works well for my needs, so this is a low priority for me. However, I expect that it can be very helpful to other people who care about highlighting for additional languages, and it gets this package closer to implementing the GFM spec/behavior fully. One main aspect that needs to be taken into account is the library size. This Investigating the size increase would be neccessary to evaluate it. |
Ok. Later I will make a PR for this ncluding the investigation of the library‘s size. |
Oh yes. I just tested it on my system and investigated, that the size of alecthomas/chroma is really huge. Consider this script: package main
import markdown "github.com/shurcooL/github_flavored_markdown"
func main() {
markdown.Markdown([]byte{})
} Size of the binary before adding chroma:
After:
So the size of library increased from 3.7MB to 19MB (~5x). |
I see, thanks for investigating that. The size increase is definitely substantial enough to say that it's not going to be possible to add That way, users who want the more comprehensive support for highlighting can have it, but others wouldn't need to pay the price in dependency size. |
Hello, @shurcooL!
What do you think about using github.com/alecthomas/chroma for syntax highlighting? It supports a bunch of languages and works great
The text was updated successfully, but these errors were encountered: