Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python code highlighter for publishing in html

I'm looking for a python code highlighter for publishing as html. I've found this site http://quickhighlighter.com that does highlighting really well. However if I try to copy/paste some python code from it to a text file, I get a mess. If you know a better tool, please let me know.

Thanks in advance.

like image 819
facha Avatar asked Oct 08 '10 11:10

facha


2 Answers

pygmentize, which handles a lot more languages than just Python and a lot more formats than just HTML.

like image 99
Ignacio Vazquez-Abrams Avatar answered Sep 23 '22 17:09

Ignacio Vazquez-Abrams


Don't get messed up with http://quickhighlighter.com I've used this too But I would suggest http://hilite.me/

If you are looking to highlight the code which is in your <code> or <pre> block you can use https://code.google.com/p/google-code-prettify/ This works well and has a lot of themes. This prettifier looks for the code block with class "prettyprint" and highlights the code.

like image 31
naren Avatar answered Sep 19 '22 17:09

naren