Elixir Makeup is a very nice package to colorize code blocks! It currently only works for HTML but as a weekend project I've been trying to create a terminal formatter! It seems to be a relatively easy task, so maybe in a couple days it will be ready!
The code is in this branch, although it is not ready yet... https://github.com/hochata/makeup/tree/feature/terminal-formatter/