Q:

Is there any syntaxhighlighter for Stata?

I have a piece of Stata code that I want to post on my website.
The code looks like this:
/* creating temporary files*/
forval i = 1964/2012 {
use mar`i', clear
unab allvars: _all
local masterlist "income race age grdatn edlev grdhi hisp spneth recnum state cntyfp cbsa hhtype hhid numper"
local keeplist: list allvars & masterlist
keep `keeplist'
save temporaryMar`i'
}
capture erase stateLevel`yearStart'-`yearEnd'.dta
/* end of temporary files establishment */

/*  *** INCOME ADJUSTMENTS ***
**  variable name "incomeStandard". making sure that 
**  income does not contain any coded values. ................ etc

In order to transform it into a good looking HTML and post it on my website I need to write the following:
<div class="geshifilter">
<pre class="java geshifilter-java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Integers <span style="color: #009900;">{</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">(</span><span style="color: #003399;">String</span><span style="color: #009900;">[</span><span style="color: #009900;">]</span> arguments<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
    <span style="color: #000066; font-weight: bold;">int</span> c<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//declaring a variable</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">/* Using for loop to repeat instruction execution */</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">(</span>c <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> c <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> c<span style="color: #339933;">++</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
      <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">(</span>c<span style="color: #009900;">)</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">}</span>
  <span style="color: #009900;">}</span>
<span style="color: #009900;">}</span></pre></div>

There is too much hassle doing this. Is there any easier way? like a syntax highlighter?

A:

There is at least one highlighter in your sense for Stata, log2html, to be installed from SSC. Given a do.file, you could do this 
 . ssc inst log2html 
 . log using mydo.smcl
 . type mydo.do
 . log close 
 . log2html mydo.smcl 

and you have an HTML file. You need to edit out some lines and the style choices may not suit. Systematic variations would be a matter for a decent text editor or scripting language. The installation using ssc need only be done once. 
Incidentally, for other readers if not yourself, the line 
 . capture erase stateLevel`yearStart'-`yearEnd'.dta

would make no sense without prior definition of the local macros used within the same .do file. 

