I am trying to take a python script and prepare it for paper printing with syntax highlighting and line numbering. I have used the following command line instruction:
pygmentize -f html -O style=colored,linenos=1 -l python -o <file>.html <file>.py
This instruction runs without errors but no matter how I indicate the style and the lexer, the output HTML never has syntax highlighting at all. It is appropriately formatted with correct indentation and line numbers, but I cannot get it to match the coloured syntax highlighting displayed when using the pygments demo, or any colours.
I have also tried different aliases of python (such as py
, python3
and py3
) and different styles, but the HTML is always the same. For what it's worth, I am using PowerShell on Windows 10 to run the instruction and Google Chrome to view the output HTML (though I have also checked with Edge and don't see any difference).