Some months ago I played a bit with the highlight C++ library (https://www.gnu.org/software/src-highlite/) and libhttpserver (https://github.com/etr/libhttpserver) to build a simple embedded pastebin server that server the source code highlighted via ansi control sequences.
Check it out: https://github.com/btwotch/pastebin
Have a lot of fun!