Have you tried "Create HTML from Document / Selection" in the TextMate bundle?<br><br><div><span class="gmail_quote">On 5/21/07, <b class="gmail_sendername">Juan Falgueras</b> <<a href="mailto:jfalgueras@uma.es">
jfalgueras@uma.es</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>        Hi<br><br>I used to need pretty print my C++ code for students and I have found
<br>the next simple script solves my problem in a cute way, since it<br>shows me the formatted code in a separate window (output "Show as<br>HTML") and then I can easily copy the source (Cmd-Opt-U) or the<br>styled text (copying directly from the output window):
<br><br>----- input "Selected text" or "Document"<br>echo "<PRE>"<br><br>enscript --language=html -Ecpp -e -B --color \<br>   --header="$TM_FILENAME|$E|pag. $% de $=" --title="$TM_FILENAME" \
<br>   -o- 2>/dev/null | \<br>perl -ne 'next if (1../<PRE>/i); last if (m|</PRE>|..1); print'<br><br>echo "</PRE>"<br>------ output "Show as HTML"<br>--- Save nothing, source.c
<br><br><br>I would like to generalize it for it to be used with other source<br>code, not only C, what should be the better way? to have a table<br>mapping modes with enscript input modes... ?<br><br>Any help will be welcome.
<br><br><br>--<br>Juan F.<br><br>______________________________________________________________________<br>For new threads USE THIS: <a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>(threading gets destroyed and the universe will collapse if you don't)
<br><a href="http://lists.macromates.com/mailman/listinfo/textmate">http://lists.macromates.com/mailman/listinfo/textmate</a><br></blockquote></div><br>