[TxMt] output pretty printing HTML in "Show as HTML" [SOLVED]

Dirk van Oosterbosch, IR labs labs at ixopusada.com
Sun Nov 5 01:18:51 UTC 2006


Let me reply myself:

I solved the 1st problem (the silencing of sudo) with this:
    echo "$PWD" | sudo -S apachectl $APACHE_CMD > /dev/null 2>&1
I first tried only > /dev/null  and didn't understand why I was still  
getting "Password:" back, but then I discovered about the stderror  
(the '2')

I still haven't figured out how to set the language of a "Create New  
Document" document from a command, but as I argued I like the "Show  
as HTML" output much better and since that succeeded ... :-)


I found pygments [1] as exactly the tool I was looking for. They  
don't support so much languages as we have in our repository, and of  
course the css styles that come with it, are not way as stunningly  
beautiful as the TextMate styles ;-) but it's quiet alright and its  
API is easy to use and well documented. I found Pygments through  
paste.e-scribe [2] ... I just wished I could use pastie's [3]  
codestyler's [4] colors and lexers ... mmm dreaming ...

Anyway, my weekend solution comes close:
    curl -s "$TEST_URL" | pygmentize -f html -l html -O  
full=True,style=friendly



[1] http://pygments.pocoo.org
[2] http://paste.e-scribe.com
[3] http://pastie.textmate.org
[4]: http://projects.serenity.de/textmate/codestyler/source.php





On 3-nov-2006, at 17:51, Dirk van Oosterbosch, IR labs wrote:

> Hi,
>
> after my successful attempt to output a "designated" test url in  
> Safari, I'd now like to make a command which shows the rendered  
> html in a TextMate browser window. That is show _the actual html  
> itself_, not the browser-interpretation of that html.
> My system of scripts and templates generate html. Now I like to see  
> that output html with nice code coloring in my favorite theme.
>
> I see roughly two solutions: output the result of 'curl "$MY_URL"'  
> in a TextMate HTML browser window or create a new (html) document  
> from that output.
>
> I would like the HTML Browser window variant much better.
> For (1) because it keeps only one window –i.e. it refreshes itself  
> when it's already open, instead of opening a 2nd window–, (2)  
> because I won't be tempted to edit the output HTML, and (3) because  
> when I might become really smart –for which the changes are  
> extremely slim, based on previous records ;)– I might be able to  
> give blocks of html code a href to jump back to the specific code  
> in the specific template file (I just *love* the TODO bundle. It  
> saved me so much time. Life has become much more convenient :-))
>
> My first problem is the with output of Apache restarting: it's not  
> quiet.
> I need Apache to restart for all the last versions of my templates  
> to become effective, but the following code
> 	echo "$PWD" | sudo -S apachectl $APACHE_CMD
> (line 43 from apachectlUsingKeychain.sh in Apache Bundle Support  
> Folder) outputs "Password:", since sudo is asking for that. Is  
> there a way to make this statement quiet?
>
> 2nd, about the Create New Document variant. How to set the scope of  
> such a newly created document? Right now there is nothing  
> indicating to TextMate that is might be html, so the output stays  
> unstyled.
>
> Finally on to the core of this email: How to get HTML pretty  
> printed in a (HTML parsing) browser window?
> I am looking at examples like pastie [1] or TextMate Theme  
> Sourcerer [2]. Are the solutions used in these web 2.0 projects  
> also available for my TextMate commands?
>
> Best
> dirk
>
>
> [1]: http://pastie.caboo.se/
> [2]: http://projects.serenity.de/textmate/codestyler/source.php
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>



-----------------------------
Dirk van Oosterbosch
de Wittenstraat 225
1052 AT Amsterdam
the Netherlands

http://labs.ixopusada.com
-----------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20061105/a67baf11/attachment.html>


More information about the textmate mailing list