Tag Archives: Pygments

Best Way to Add Syntax Highlighting to Code On Your Website With Python

In this post I’ll show you how you can add Syntax Highlighting to your code without using any client-side Javascript like some syntax highlighter plugins use. Just copy the code to your clipboard, run my script which will put the stylized code into your clipboard, then paste it into your post. That’s it! It’s based on Pygments (Python Syntax Highlighter), which will also automatically generate the CSS you need to add to your site. The result is better-looking than any other method, in my opinion. And it was easier too!

Continue reading

Posted in Python | Tagged , , , | Leave a comment