tech.agilitynerd.com

scratching that itch... 
Filed under

source highlighting

 

Highlighter - Online Source Highlighting Service

I got tired of using <tt> elements to style the source code in this blog so I went looking for a tool that will convert code to html with syntax coloring. I found the online Highlighter service does a nice job.

It handles a number of languages including: C++, Java, JavaScript, Python, Ruby, XML, SQL and some others. The supplied CSS style sheet has reasonable defaults for coloring and allows you to modify the output to suite your needs. Here is an example of some Python code for my Googility site:

  1. class AtomLatestFeed(RssLatestFeed):  
  2.     feed_type = Atom1Feed  
  3.     subtitle = RssLatestFeed.description  
  4.     link = "/feeds/atom/"  
  5.   
  6.     def item_pubdate(self, item):  
  7.         return item.modified  

 

So give it a whirl. I'd be interested to know if there are other services anyone likes better.

Filed under  //   source highlighting   web development  

Comments [0]