[TxMt] Re: Adding Executor/Run Script for Custom Bundles

grosven grosven at gmail.com
Thu May 6 08:37:45 UTC 2010


Rob! Thanks so much--this is way helpful, and much more elegant than
my previous web preview solution :) I was specifically trying to
figure out how I get the terminal-type output in the html window, like
when I run my perl scripts.

For example this is what I put in the terminal, and it outputs to html
or css:

kenny-scotts-computer:zmltest grosven$ zml dockey9.txt
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html language="ru" xml:lang="en" xmlns="http://www.w3.org/1999/
xhtml"><head><meta http-equiv="content-type" content="text/html;
charset=KOI8-R"/><meta http-equiv="content-language" content="ru"/
><meta name="MSSmartTagsPreventParsing" content="true"/> <title>That's
a document title</title><link href="/img/favicon.ico" rel="icon"/
><link href="/img/favicon.ico" rel="shortcut icon"/>
</head><body>Here goes the body<script type="text/javascript">//<!
[CDATA[

//]]>
</script></body></html>

Thanks, again, for sharing your brain.

-Kenny

On May 5, 5:13 am, Rob McBroom <mailingli... at skurfer.com> wrote:
> On May 3, 2010, at 4:36 PM, Kenny Scott wrote:
>
> > I really love the functionality, with apple command + R that allows me to run a Perl Script or Shell Script, or what have you, and display the results in HTML. This would be really helpful, in place of being forced to run each document in terminal to view the output. My command is simply "zml myzmlfile.txt" and I want to leverage the bundle editor to get this going.
>
> Create a command along these lines:
>
>     . "$TM_SUPPORT_PATH/lib/webpreview.sh"
>     html_header "Some title for the window"
>
>     zml "$TM_FILEPATH"
>
>     html_footer
>
> You'll probably want nothing for input and output. Be sure to set the scope selector so it only applies to ZML.
>
> Take a look at the "Preview" command in the Markdown bundle. That's a fairly simple example of a command that uses the "web preview" window.
>
> --
> Rob McBroom
> <http://www.skurfer.com/>
>
> Because it screws up the order in which people normally read text.
>
> Original message:
>
> > Why is it bad to top-post your reply?
>
> _______________________________________________
> textmate mailing list
> textm... at lists.macromates.comhttp://lists.macromates.com/listinfo/textmate



More information about the textmate mailing list