Nice work, I certainly think this is a nice pet project where the author learned a ton, however this looks too convoluted for my personal taste.
In my case, I use an Alfred workflow that formats the code snippet and then I can just paste the formatted code into Keynote/Powerpoint. It supports several color themes and it's super fast https://github.com/importre/alfred-hl