Thanks Dougal, it is very impressive, really.
...but, why it doesn't colour when you give it selections? ehmmm
I usually need to cut functions, etc...
but anyway the Brad Choate solution is much much better than the enscript one. Thanks
Is there some trick for make B. Choate script to colour portions of text?
Thanks!
De: Dougal dougal@gmail.com Fecha: 22 de mayo de 2007 01:59:38 GMT+02:00 Para: "TextMate users" textmate@lists.macromates.com Asunto: Re: [TxMt] html pretty print Responder a: TextMate users textmate@lists.macromates.com
Have you tried "Create HTML from Document / Selection" in the TextMate bundle?
On 5/21/07, Juan Falgueras < jfalgueras@uma.es> wrote:
Hi
I used to need pretty print my C++ code for students and I have found the next simple script solves my problem in a cute way, since it shows me the formatted code in a separate window (output "Show as HTML") and then I can easily copy the source (Cmd-Opt-U) or the styled text (copying directly from the output window):
----- input "Selected text" or "Document" echo "<PRE>"
enscript --language=html -Ecpp -e -B --color \ --header="$TM_FILENAME|$E|pag. $% de $=" --title="$TM_FILENAME" \ -o- 2>/dev/null | \ perl -ne 'next if (1../<PRE>/i); last if (m|</PRE>|..1); print'
echo "</PRE>" ------ output "Show as HTML" --- Save nothing, source.c
I would like to generalize it for it to be used with other source code, not only C, what should be the better way? to have a table mapping modes with enscript input modes... ?
Any help will be welcome.
-- Juan F.
Juan Falgueras wrote:
....but, why it doesn't colour when you give it selections? ehmmm
I usually need to cut functions, etc...
but anyway the Brad Choate solution is much much better than the enscript one. Thanks
Is there some trick for make B. Choate script to colour portions of text?
You're going to have to explain what you're having trouble with. I have no trouble turning selections to html with that command...
-Jacob
When you use the command, it spits out lots of <span class="text text_tex text_tex_latex"> things, but the CSS definitions only seems to come when you do a full document.
If you look at the command definition, this is right in there: :include_css => !ENV.has_key?('TM_SELECTED_TEXT')
My guess is that this is so you can more easily paste different chunks into one bigger document. If you want to always include the css, just change that to :include_css => true. Or if you'd rather leave it as-is, just paste what you wanted into a new document before HTML-izing it.
On 5/22/07, Jacob Rus jacobolus@gmail.com wrote:
Juan Falgueras wrote:
....but, why it doesn't colour when you give it selections? ehmmm
I usually need to cut functions, etc...
but anyway the Brad Choate solution is much much better than the enscript one. Thanks
Is there some trick for make B. Choate script to colour portions of
text?
You're going to have to explain what you're having trouble with. I have no trouble turning selections to html with that command...
-Jacob
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate