I am looking for a command line tool (or a Perl module or VIM script or something else) that will take some input files (like XML or JavaScript files) and format them in HTML. I specifically want my output to not contain such things as <span style="color: red">or <font color=red>according to a specific color scheme, instead it should use CSS class names to mark up the various syntax parts of the file.
For example, if I had this file as input:
function f(x) {
return x + 1;
}
the type of output I would like:
<pre><span class=keyword>function</span> <span class=ident>f</span><span class=punc>{</span>
<span class=keyword>return</span> <span class=ident>x</span> <span class=op>+</span> <span class=numliteral>1</span><span class=punc>;</span>
<span class=punc>}</span></pre>
Does anyone know about such a tool?
- VIM 2html.vim script, class= " (," "," "," " ..) .
,