Syntax Highlighting in Impress

I want to do a presentation with lots of code fragments.

What is the preferred way to include this fragments with syntax highlighting in Impress?

I’ve also had the same problem and found impress-code-highlighter.

To use it, you need to create custom text boxes (different from the default bulleted text boxes) with names like code-Html, code-Css,…
It uses highlighting from pygments Lexers so the style names need to correspond to the Lexer names when the postfix is removed.

Once you have the correct styles, you can follow the instructions from the GitHub Readme of the project:

soffice "--accept=socket,host=localhost,port=2002;urp;" your_presentation.odp
python highlight.py