Hey Guys,
A friend pointed me to the this list! Way excited. Any of you guys have experience adding the run script for a new bundle? I'm helping a friend with a new open source markup language called ZML.We added a bundle to TextMate and added the syntax highlighter.
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.
Anyone have experience doing this? I obviously, do not.
Thanks in Advance!
Kenny G
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! 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...@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...@lists.macromates.comhttp://lists.macromates.com/listinfo/textmate
On May 6, 2010, at 4:37 AM, grosven wrote:
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.
I'm not completely clear on what your asking. The example you gave seems like the scenario that you asked about in the original post, which the command should handle.
The only thing I'm not sure about is you supplying DOCTYPE, etc. The `webpreview.sh` might already supply it's own "wrapper" HTML. If that's causing a problem for you, I think you could change the command to just run the `zml` part and set the output to "Show as HTML" in the command's drop-down.
Thanks, Rob. I'm obviously a total novice, sorry for the confusion. What it is giving me is very helpful. It is giving me a preview of HTML, so it is showing as a webpage. When I run it in terminal it simply takes my ZML input and outputs into HTML, and it shows basically as source. This is helpful sometimes, but not as critical as the solution you posted. It would just be a nice to have.
So, I simply need to bust out
zml "$TM_FILEPATH"
Do you think that will work? I don't have my mac with me at work right now, but I'll check it out when I get home. Thanks again. You are the man!
On May 6, 11:40 am, Rob McBroom mailingli...@skurfer.com wrote:
On May 6, 2010, at 4:37 AM, grosven wrote:
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.
I'm not completely clear on what your asking. The example you gave seems like the scenario that you asked about in the original post, which the command should handle.
The only thing I'm not sure about is you supplying DOCTYPE, etc. The `webpreview.sh` might already supply it's own "wrapper" HTML. If that's causing a problem for you, I think you could change the command to just run the `zml` part and set the output to "Show as HTML" in the command's drop-down.
-- Rob McBroom http://www.skurfer.com/
textmate mailing list textm...@lists.macromates.comhttp://lists.macromates.com/listinfo/textmate
On May 6, 2010, at 4:02 PM, grosven wrote:
What it is giving me is very helpful. It is giving me a preview of HTML, so it is showing as a webpage. When I run it in terminal it simply takes my ZML input and outputs into HTML, and it shows basically as source. This is helpful sometimes, but not as critical as the solution you posted. It would just be a nice to have.
If you want to see the HTML source instead of the rendered version, I think just change the output to "Create New Document". Or you could have a command for each scenario.