LibreOffice Writer has an extension called Code Highlighter 2.

https://extensions.libreoffice.org/en/extensions/show/5814

Ah, thanks, that looks cool. It's missing the core functionality I want though, which is to follow links to code on github. Maybe if this doesn't exist, I'll see if I can make something!