If you still use Github, I wonder why not save the html and specified css files and run them through the html2pdf converter, say Pisa converter .
With a little css setup, I suppose you get high-quality, well-formatted pdf files just like you do.
Alternatively, you can store diff in txt files and pass them through libraries containing html to highlight syntax like Pygments and follow a similar process with Pisa, as described above.
Lakshman prasad
source share