Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert code to syntax highlighted html [closed]

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.

like image 386
Artium Avatar asked Jul 06 '12 17:07

Artium


People also ask

How do I print codes with syntax highlighting?

Simply open the file on command line with vim <filename> , type :syntax on<ENTER> , then :hardcopy<ENTER> to print it.

How do you use react syntax highlighter?

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.


1 Answers

You probably want pygments.

It highlights most popular languages and outputs to HTML, RDF, LaTeX, and many more.

like image 195
cha0site Avatar answered Oct 25 '22 12:10

cha0site