I am looking for a python module that will let me generate "syntax highlighted" HTML code out of a code written in any of the popular languages.
Something similar to what stackoverflow does with the code tag.
Simply open the file on command line with vim <filename> , type :syntax on<ENTER> , then :hardcopy<ENTER> to print it.
You need to install prism–react–renderer from NPM to use it. Prism react renderer exposes Highlight as its main component and exports some default props, which you can pass to Highlight . You need to pass a render prop to the Highlight component as in the example below.
You probably want pygments.
It highlights most popular languages and outputs to HTML, RDF, LaTeX, and many more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With